本文整理匯總了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;
}