本文整理汇总了Java中org.semanticweb.owlapi.model.OWLAxiom.getNestedClassExpressions方法的典型用法代码示例。如果您正苦于以下问题:Java OWLAxiom.getNestedClassExpressions方法的具体用法?Java OWLAxiom.getNestedClassExpressions怎么用?Java OWLAxiom.getNestedClassExpressions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLAxiom
的用法示例。
在下文中一共展示了OWLAxiom.getNestedClassExpressions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nameObjectSomeValuesFrom
import org.semanticweb.owlapi.model.OWLAxiom; //导入方法依赖的package包/类
/**
* Names all inner ObjectSomeValuesFrom expressions
*
* @param srcOntology
* @param tgtOntology
* @param qmap
* @param isAddLabels
* @return
*/
public static Map<OWLClass, OWLClassExpression> nameObjectSomeValuesFrom(OWLOntology srcOntology,
OWLOntology tgtOntology,
Map<OWLClass,OWLClassExpression> qmap,
boolean isAddLabels) {
if (qmap == null)
qmap = new HashMap<OWLClass, OWLClassExpression>();
OWLOntologyManager mgr = srcOntology.getOWLOntologyManager();
OWLDataFactory df = mgr.getOWLDataFactory();
for (OWLOntology ont : srcOntology.getImportsClosure()) {
for (OWLAxiom ax : srcOntology.getAxioms()) {
for (OWLClassExpression x : ax.getNestedClassExpressions()) {
if (x instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom)x;
OWLClass filler = (OWLClass) svf.getFiller();
OWLObjectProperty p = (OWLObjectProperty) svf.getProperty();
IRI iri = getSkolemIRI(filler, p);
OWLClass c = df.getOWLClass(iri);
mgr.addAxiom(tgtOntology, df.getOWLEquivalentClassesAxiom(c, svf));
qmap.put(c, svf);
if (isAddLabels) {
Set<OWLAnnotation> anns = OwlHelper.getAnnotations(filler, df.getRDFSLabel(), ont);
for (OWLAnnotation ann : anns) {
mgr.addAxiom(tgtOntology, df.getOWLAnnotationAssertionAxiom(c.getIRI(), ann));
}
}
}
}
}
}
return qmap;
}