当前位置: 首页>>代码示例>>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;未经允许,请勿转载。