当前位置: 首页>>代码示例>>Java>>正文


Java OWLIndividual.asOWLNamedIndividual方法代码示例

本文整理汇总了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;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:22,代码来源:ModelAnnotationSolrDocumentLoader.java

示例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;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:19,代码来源:ModelAnnotationSolrDocumentLoader.java

示例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);
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:29,代码来源:StructuralReasoner2.java

示例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);
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:15,代码来源:InferredSimpleListIterator.java

示例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();
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:7,代码来源:AxiomTranslator.java


注:本文中的org.semanticweb.owlapi.model.OWLIndividual.asOWLNamedIndividual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。