當前位置: 首頁>>代碼示例>>Java>>正文


Java OWLOntology.getClassAssertionAxioms方法代碼示例

本文整理匯總了Java中org.semanticweb.owlapi.model.OWLOntology.getClassAssertionAxioms方法的典型用法代碼示例。如果您正苦於以下問題:Java OWLOntology.getClassAssertionAxioms方法的具體用法?Java OWLOntology.getClassAssertionAxioms怎麽用?Java OWLOntology.getClassAssertionAxioms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.semanticweb.owlapi.model.OWLOntology的用法示例。


在下文中一共展示了OWLOntology.getClassAssertionAxioms方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTypes

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public NodeSet<OWLClass> getTypes(OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
    for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
        for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(ind)) {
            OWLClassExpression ce = axiom.getClassExpression();
            if (!ce.isAnonymous()) {
                result.addNode(classHierarchyInfo.getEquivalents(ce.asOWLClass()));
                if (!direct) {
                    result.addAllNodes(getSuperClasses(ce, false).getNodes());
                }
            }
        }
    }
    return result;
}
 
開發者ID:ernestojimenezruiz,項目名稱:logmap-matcher,代碼行數:17,代碼來源:StructuralReasoner2.java

示例2: removeDangningAnnotations

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
@CLIMethod("--remove-dangling-annotations")
public void removeDangningAnnotations(Opts opts) throws Exception {
	OWLOntology ont = g.getSourceOntology();
	int n = 0;
	Set<OWLAxiom> rmAxioms = new HashSet<OWLAxiom>();
	for (OWLNamedIndividual i : ont.getIndividualsInSignature()) {
		for (OWLClassAssertionAxiom ca : ont.getClassAssertionAxioms(i)) {
			OWLClassExpression cx = ca.getClassExpression();
			if (cx instanceof OWLClass) {
				OWLClass c = (OWLClass) cx;
				String label = g.getLabel(c);
				if (label == null)
					rmAxioms.add(ca);
				else
					n++;
			}
		}
	}
	LOG.info("Removing " + rmAxioms.size() + " axioms");
	ont.getOWLOntologyManager().removeAxioms(ont, rmAxioms);
	LOG.info("Remaining: " + n + " axioms");
}
 
開發者ID:owlcollab,項目名稱:owltools,代碼行數:23,代碼來源:Sim2CommandRunner.java

示例3: getSvfTypes

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private Set<OWLObjectSomeValuesFrom> getSvfTypes(OWLNamedIndividual i, OWLOntology model) {
	Set<OWLClassAssertionAxiom> axioms = model.getClassAssertionAxioms(i);
	final Set<OWLObjectSomeValuesFrom> svfs = new HashSet<OWLObjectSomeValuesFrom>();
	for (OWLClassAssertionAxiom axiom : axioms) {
		axiom.getClassExpression().accept(new OWLClassExpressionVisitorAdapter(){

			@Override
			public void visit(OWLObjectSomeValuesFrom svf) {
				svfs.add(svf);
			}
		});
	}
	return svfs;
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:15,代碼來源:LegoModelWalker.java

示例4: getTypes

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private Set<OWLClass> getTypes(OWLNamedIndividual i, OWLOntology model) {
	Set<OWLClassAssertionAxiom> axioms = model.getClassAssertionAxioms(i);
	Set<OWLClass> types = new HashSet<OWLClass>();
	for (OWLClassAssertionAxiom axiom : axioms) {
		OWLClassExpression ce = axiom.getClassExpression();
		if (ce instanceof OWLClass) {
			OWLClass cls = ce.asOWLClass();
			if (cls.isBuiltIn() == false) {
				types.add(cls);
			}
		}
	}
	return types;
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:15,代碼來源:LegoModelWalker.java

示例5: getInstances

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce, boolean direct) throws InconsistentOntologyException, ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    DefaultNodeSet<OWLNamedIndividual> result = new OWLNamedIndividualNodeSet();
    if (!ce.isAnonymous()) {
        OWLClass cls = ce.asOWLClass();
        Set<OWLClass> clses = new HashSet<OWLClass>();
        clses.add(cls);
        if (!direct) {
            clses.addAll(getSubClasses(cls, false).getFlattened());
        }
        for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
            for (OWLClass curCls : clses) {
                for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(curCls)) {
                    OWLIndividual individual = axiom.getIndividual();
                    if (!individual.isAnonymous()) {
                        if (getIndividualNodeSetPolicy().equals(IndividualNodeSetPolicy.BY_SAME_AS)) {
                            result.addNode(getSameIndividuals(individual.asOWLNamedIndividual()));
                        }
                        else {
                            result.addNode(new OWLNamedIndividualNode(individual.asOWLNamedIndividual()));
                        }
                    }
                }
            }
        }
    }
    return result;
}
 
開發者ID:ernestojimenezruiz,項目名稱:logmap-matcher,代碼行數:29,代碼來源:StructuralReasoner2.java

示例6: getConceptSchemes

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public Set<OWLNamedIndividual> getConceptSchemes () {

        Set<OWLNamedIndividual> inds = new HashSet<OWLNamedIndividual>(10);

        for (OWLOntology onto  : getOWLEditorKit().getModelManager().getOntologies()) {
            Set<OWLClassAssertionAxiom> axioms = onto.getClassAssertionAxioms(getOWLEditorKit().getModelManager().getOWLDataFactory().getOWLClass(SKOSVocabulary.CONCEPTSCHEME.getIRI()));
            for (OWLClassAssertionAxiom axiom : axioms) {
                inds.add(axiom.getIndividual().asOWLNamedIndividual());
            }

        }
        return inds;
    }
 
開發者ID:simonjupp,項目名稱:skoseditor,代碼行數:14,代碼來源:SKOSConceptSchemeInferredHierarchyViewComponent.java

示例7: getConceptSchemes

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public static Set<OWLIndividual> getConceptSchemes (OWLEditorKit owlEditorKit) {

        Set<OWLIndividual> inds = new HashSet<OWLIndividual>();

        for (OWLOntology onto  : owlEditorKit.getModelManager().getOntologies()) {
            Set<OWLClassAssertionAxiom> axioms = onto.getClassAssertionAxioms(owlEditorKit.getModelManager().getOWLDataFactory().getOWLClass(SKOSVocabulary.CONCEPTSCHEME.getIRI()));
            for (OWLClassAssertionAxiom clssAx : axioms) {
                inds.add(clssAx.getIndividual());
            }
        }
        return inds;
    }
 
開發者ID:simonjupp,項目名稱:skoseditor,代碼行數:13,代碼來源:ConceptSchemeComboBox.java

示例8: getTypes

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public static Set<OWLClassExpression> getTypes(OWLNamedIndividual i, OWLOntology ont) {
	Set<OWLClassExpression> types;
	if (i != null && ont != null) {
		types = new HashSet<>();
		for (OWLClassAssertionAxiom axiom : ont.getClassAssertionAxioms(i)) {
			types.add(axiom.getClassExpression());
		}
	}
	else {
		types = Collections.emptySet();
	}
	return types;
}
 
開發者ID:owlcollab,項目名稱:owltools,代碼行數:14,代碼來源:OwlHelper.java


注:本文中的org.semanticweb.owlapi.model.OWLOntology.getClassAssertionAxioms方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。