本文整理汇总了Java中com.hp.hpl.jena.ontology.Individual.listPropertyValues方法的典型用法代码示例。如果您正苦于以下问题:Java Individual.listPropertyValues方法的具体用法?Java Individual.listPropertyValues怎么用?Java Individual.listPropertyValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.ontology.Individual
的用法示例。
在下文中一共展示了Individual.listPropertyValues方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: obtainMappings
import com.hp.hpl.jena.ontology.Individual; //导入方法依赖的package包/类
private List<URI> obtainMappings(Individual individual, Property mappingProperty) throws URISyntaxException {
List<URI> result = new ArrayList<URI>();
if (individual == null || mappingProperty == null)
return result;
NodeIterator nodeIterator = null;
Resource schemaMap;
RDFNode node;
try {
nodeIterator = individual.listPropertyValues(mappingProperty);
while (nodeIterator.hasNext()) {
node = nodeIterator.next();
if (node.isResource()) {
schemaMap = node.asResource();
result.add(new URI(schemaMap.getURI()));
}
}
} finally {
if (nodeIterator != null)
nodeIterator.close();
}
return result;
}
示例2: obtainParts
import com.hp.hpl.jena.ontology.Individual; //导入方法依赖的package包/类
private List<MessagePart> obtainParts(Individual individual, Property partsProperty) throws URISyntaxException {
List<MessagePart> result = new ArrayList<MessagePart>();
if (individual == null)
return result;
RDFNode node;
MessagePart messagePart;
NodeIterator nodeIterator = null;
try {
nodeIterator = individual.listPropertyValues(partsProperty);
while (nodeIterator.hasNext()) {
node = nodeIterator.next();
messagePart = obtainMessagePart(node);
if (messagePart != null)
result.add(messagePart);
}
} finally {
if (nodeIterator != null)
nodeIterator.close();
}
return result;
}
示例3: addInstancePropertyValue
import com.hp.hpl.jena.ontology.Individual; //导入方法依赖的package包/类
private void addInstancePropertyValue(Individual inst, Property prop, RDFNode value, EObject ctx) {
if (prop.getURI().equals(SadlConstants.SADL_IMPLICIT_MODEL_IMPLIED_PROPERTY_URI)) {
// check for ambiguity through duplication of property range
if (value.canAs(OntProperty.class)) {
NodeIterator ipvs = inst.listPropertyValues(prop);
if (ipvs.hasNext()) {
List<OntResource> valueRngLst = new ArrayList<OntResource>();
ExtendedIterator<? extends OntResource> vitr = value.as(OntProperty.class).listRange();
while (vitr.hasNext()) {
valueRngLst.add(vitr.next());
}
vitr.close();
boolean overlap = false;
while (ipvs.hasNext()) {
RDFNode ipv = ipvs.next();
if (ipv.canAs(OntProperty.class)) {
ExtendedIterator<? extends OntResource> ipvitr = ipv.as(OntProperty.class).listRange();
while (ipvitr.hasNext()) {
OntResource ipvr = ipvitr.next();
if (valueRngLst.contains(ipvr)) {
addError("Ambiguous condition--multiple implied properties ("
+ value.as(OntProperty.class).getLocalName() + ","
+ ipv.as(OntProperty.class).getLocalName() + ") have the same range ("
+ ipvr.getLocalName() + ")", ctx);
}
}
}
}
}
}
addImpliedPropertyClass(inst);
} else if (prop.getURI().equals(SadlConstants.SADL_IMPLICIT_MODEL_EXPANDED_PROPERTY_URI)) {
addExpandedPropertyClass(inst);
}
inst.addProperty(prop, value);
logger.debug("added value '" + value.toString() + "' to property '" + prop.toString() + "' for instance '"
+ inst.toString() + "'");
}
示例4: obtainAxioms
import com.hp.hpl.jena.ontology.Individual; //导入方法依赖的package包/类
private List<? extends LogicalAxiom> obtainAxioms(Individual individual, Class<? extends LogicalAxiom> axiomClass) throws URISyntaxException {
List<? extends LogicalAxiom> result;
Resource resourceType;
if (axiomClass.equals(Condition.class)) {
result = new ArrayList<Condition>();
resourceType = WSMO_LITE.Condition;
} else if (axiomClass.equals(Effect.class)) {
result = new ArrayList<Effect>();
resourceType = WSMO_LITE.Effect;
} else {
// We just sent it empty. The type does not matter
return new ArrayList<Effect>();
}
RDFNode node;
NodeIterator nodeIterator = null;
// Process the appropriate model references
try {
nodeIterator = individual.listPropertyValues(SAWSDL.modelReference);
FilterByRdfType typeFilter = new FilterByRdfType(resourceType);
ExtendedIterator<RDFNode> filteredIter = nodeIterator.filterKeep(typeFilter);
while (filteredIter.hasNext()) {
node = filteredIter.next();
Individual axiomIndiv = node.as(Individual.class); // Should be possible given the filter
if (axiomClass.equals(Condition.class)) {
Condition cond;
if (axiomIndiv.isAnon()) {
cond = new Condition(null);
} else {
cond = new Condition(new URI(axiomIndiv.getURI()));
}
setResourceProperties(axiomIndiv, cond);
cond.setTypedValue(getAxiom(axiomIndiv));
((List<Condition>) result).add(cond);
} else if (axiomClass.equals(Effect.class)) {
Effect effect;
if (axiomIndiv.isAnon()) {
effect = new Effect(null);
} else {
effect = new Effect(new URI(axiomIndiv.getURI()));
}
setResourceProperties(axiomIndiv, effect);
effect.setTypedValue(getAxiom(axiomIndiv));
((List<Effect>) result).add(effect);
}
}
} finally {
if (nodeIterator != null)
nodeIterator.close();
}
return result;
}
示例5: setResourceProperties
import com.hp.hpl.jena.ontology.Individual; //导入方法依赖的package包/类
private void setResourceProperties(Individual individual, uk.ac.open.kmi.msm4j.Resource result) throws URISyntaxException {
Resource res;
result.setComment(individual.getComment(null));
result.setLabel(individual.getLabel(null));
// seeAlso
NodeIterator seeAlsoIterator = individual.listPropertyValues(RDFS.seeAlso);
for (RDFNode seeAlsoValue : seeAlsoIterator.toList()) {
result.addSeeAlso(new URI(seeAlsoValue.asResource().getURI()));
}
// source
res = individual.getPropertyResourceValue(DCTerms.source);
if (res != null) {
result.setSource(new URI(res.getURI()));
}
// creator
res = individual.getPropertyResourceValue(DCTerms.creator);
if (res != null) {
result.setCreator(new URI(res.getURI()));
}
// created
Date created = getDate(individual, DCTerms.created);
if (created != null) {
result.setCreated(created);
}
// issued
Date issued = getDate(individual, DCTerms.issued);
if (issued != null) {
result.setIssued(issued);
}
//licenses
NodeIterator licenseIterator = individual.listPropertyValues(DCTerms.license);
for (RDFNode licenseValue : licenseIterator.toList()) {
result.addLicense(new URI(licenseValue.asResource().getURI()));
}
//owl:sameAs
NodeIterator sameAsIterator = individual.listPropertyValues(OWL2.sameAs);
for (RDFNode sameAsValue : sameAsIterator.toList()) {
result.addSameAs(new URI(sameAsValue.asResource().getURI()));
}
}