本文整理汇总了Java中org.semanticweb.owlapi.model.OWLOntology.getDataPropertiesInSignature方法的典型用法代码示例。如果您正苦于以下问题:Java OWLOntology.getDataPropertiesInSignature方法的具体用法?Java OWLOntology.getDataPropertiesInSignature怎么用?Java OWLOntology.getDataPropertiesInSignature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLOntology
的用法示例。
在下文中一共展示了OWLOntology.getDataPropertiesInSignature方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOntoDataProperty
import org.semanticweb.owlapi.model.OWLOntology; //导入方法依赖的package包/类
/**
* Get the {@link OWLDataProperty} object corresponding to a named data
* property (i.e. attribute in OO) of the ontology.
* @param onto
* @param name
* @return
*/
public static OWLDataProperty getOntoDataProperty(OWLOntology onto,
String name) {
for (OWLDataProperty p : onto.getDataPropertiesInSignature())
if (p.getIRI().getFragment().equals(name))
return p;
return null;
}
示例2: getEntities
import org.semanticweb.owlapi.model.OWLOntology; //导入方法依赖的package包/类
@Override
protected Set<OWLDataProperty> getEntities(OWLOntology ont) {
return ont.getDataPropertiesInSignature();
}
示例3: getAxioms
import org.semanticweb.owlapi.model.OWLOntology; //导入方法依赖的package包/类
/**
* Get axioms from ontology depending on requirements
* @param ontology
* @param considerImportsClosure
* @param considerEntityAnnotations
* @param ignoreAssertions
* @return
*/
private static Set<OWLAxiom> getAxioms(
OWLOntology ontology,
boolean considerImportsClosure,
boolean considerEntityAnnotations,
boolean ignoreAssertions){
Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
//axioms.addAll(ontology.getGeneralClassAxioms());
axioms.addAll(ontology.getTBoxAxioms(considerImportsClosure));
axioms.addAll(ontology.getRBoxAxioms(considerImportsClosure));
if (!ignoreAssertions){
axioms.addAll(ontology.getABoxAxioms(considerImportsClosure));
}
if (considerEntityAnnotations){
for (OWLClass cls : ontology.getClassesInSignature(considerImportsClosure)){
axioms.addAll(cls.getAnnotationAssertionAxioms(ontology));
//axioms.addAll(ontology.getDeclarationAxioms(cls));
}
for (OWLObjectProperty oprop : ontology.getObjectPropertiesInSignature(considerImportsClosure)){
axioms.addAll(oprop.getAnnotationAssertionAxioms(ontology));
//axioms.addAll(ontology.getDeclarationAxioms(oprop));
}
for (OWLDataProperty dprop : ontology.getDataPropertiesInSignature(considerImportsClosure)){
axioms.addAll(dprop.getAnnotationAssertionAxioms(ontology));
//axioms.addAll(ontology.getDeclarationAxioms(dprop));
}
for (OWLAnnotationProperty aprop : ontology.getAnnotationPropertiesInSignature()){
axioms.addAll(aprop.getAnnotationAssertionAxioms(ontology));
//axioms.addAll(ontology.getDeclarationAxioms(aprop));
}
if (!ignoreAssertions){
for (OWLNamedIndividual indiv : ontology.getIndividualsInSignature(considerImportsClosure)){
axioms.addAll(indiv.getAnnotationAssertionAxioms(ontology));
//axioms.addAll(ontology.getDeclarationAxioms(indiv));
}
//TODO In pizza.owl gives an error
//for (OWLAnonymousIndividual aindiv : ontology.getAnonymousIndividuals()){
// axioms.addAll(ontology.getAnnotationAssertionAxioms(aindiv));
//}
}
}
/*for (OWLAxiom ax : ontology.getAxioms()){
if (!axioms.contains(ax)){
System.out.println(ax);
}
}*/
return axioms;
}