本文整理汇总了Java中org.semanticweb.owlapi.model.OWLIndividual.asOWLNamedIndividual方法的典型用法代码示例。如果您正苦于以下问题:Java OWLIndividual.asOWLNamedIndividual方法的具体用法?Java OWLIndividual.asOWLNamedIndividual怎么用?Java OWLIndividual.asOWLNamedIndividual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLIndividual
的用法示例。
在下文中一共展示了OWLIndividual.asOWLNamedIndividual方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findProcesses
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
private Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> findProcesses(OWLNamedIndividual mf) {
Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> result = new HashMap<OWLClass, Pair<OWLNamedIndividual,Set<OWLAnnotation>>>();
Set<OWLObjectPropertyAssertionAxiom> axioms = model.getObjectPropertyAssertionAxioms(mf);
for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
if (partOf.equals(axiom.getProperty()) && mf.equals(axiom.getSubject())) {
// relevant axiom
OWLIndividual bpCandidate = axiom.getObject();
if (bpCandidate.isNamed()) {
final OWLNamedIndividual named = bpCandidate.asOWLNamedIndividual();
Set<OWLClass> bpTypes = getTypes(named);
for (OWLClass bpType : bpTypes) {
if (bpSet.contains(bpType) == false) {
continue;
}
result.put(bpType, Pair.of(named, getAnnotations(axiom, named)));
}
}
}
}
return result;
}
示例2: findLocations
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
private Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> findLocations(OWLNamedIndividual mf) {
Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> result = new HashMap<OWLClass, Pair<OWLNamedIndividual,Set<OWLAnnotation>>>();
Set<OWLObjectPropertyAssertionAxiom> axioms = model.getObjectPropertyAssertionAxioms(mf);
for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
if (occursIn.equals(axiom.getProperty()) && mf.equals(axiom.getSubject())) {
// relevant axiom
OWLIndividual locationCandidate = axiom.getObject();
if (locationCandidate.isNamed()) {
OWLNamedIndividual named = locationCandidate.asOWLNamedIndividual();
Set<OWLClass> locationTypes = getTypes(named);
for (OWLClass locationType : locationTypes) {
result.put(locationType, Pair.of(named, getAnnotations(axiom, named)));
}
}
}
}
return result;
}
示例3: getSameIndividuals
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual ind) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
ensurePrepared();
Set<OWLNamedIndividual> inds = new HashSet<OWLNamedIndividual>();
Set<OWLSameIndividualAxiom> processed = new HashSet<OWLSameIndividualAxiom>();
List<OWLNamedIndividual> stack = new ArrayList<OWLNamedIndividual>();
stack.add(ind);
while (!stack.isEmpty()) {
OWLNamedIndividual currentInd = stack.remove(0);
for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
for (OWLSameIndividualAxiom axiom : ontology.getSameIndividualAxioms(currentInd)) {
if (!processed.contains(axiom)) {
processed.add(axiom);
for (OWLIndividual i : axiom.getIndividuals()) {
if (!i.isAnonymous()) {
OWLNamedIndividual namedInd = i.asOWLNamedIndividual();
if (!inds.contains(namedInd)) {
inds.add(namedInd);
stack.add(namedInd);
}
}
}
}
}
}
}
return new OWLNamedIndividualNode(inds);
}
示例4: next
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
@Override
public Axiom<NamedResource> next() {
if (!hasNext()) {
throw new NoSuchElementException("There are no more elements.");
}
checkMaxSuccessors(previousProperty, next);
final OWLIndividual item = next.iterator().next(); // We know the individual is named
this.currentNode = item.asOWLNamedIndividual();
final NamedResource subject = NamedResource.create(previousNode.getIRI().toURI());
final NamedResource value = NamedResource.create(currentNode.getIRI().toURI());
final Assertion assertion = Assertion.createObjectPropertyAssertion(previousProperty.getIRI().toURI(), false);
doStep();
return axiomAdapter.createAxiom(subject, assertion, value);
}
示例5: asOWLNamedIndividual
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
private OWLNamedIndividual asOWLNamedIndividual(OWLIndividual individual) {
if (!(individual instanceof OWLNamedIndividual)) {
throw new TranslationException("Individual cannot be translated: '" + individual + "'.");
}
return individual.asOWLNamedIndividual();
}