本文整理汇总了Java中org.semanticweb.owlapi.model.OWLEntity.isOWLObjectProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OWLEntity.isOWLObjectProperty方法的具体用法?Java OWLEntity.isOWLObjectProperty怎么用?Java OWLEntity.isOWLObjectProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLEntity
的用法示例。
在下文中一共展示了OWLEntity.isOWLObjectProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLDeclarationAxiom axiom) {
Objects.requireNonNull(axiom);
OWLEntity entity = axiom.getEntity();
if (entity.isOWLClass()) {
return declare(entity.asOWLClass(), axiom.getAnnotations());
} else if (entity.isOWLObjectProperty()) {
return declare(entity.asOWLObjectProperty(), axiom.getAnnotations());
} else if (entity.isOWLNamedIndividual()) {
return declare(entity.asOWLNamedIndividual(), axiom.getAnnotations());
} else if (entity.isOWLDataProperty()) {
return declare(entity.asOWLDataProperty(), axiom.getAnnotations());
} else if (entity.isOWLAnnotationProperty()) {
// FIXME add annotation property
return Collections.emptySet();
} else {
throw TranslationException.newUnsupportedAxiomException(axiom);
}
}
示例2: extract
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
/**
* Extracts {@link PredicateVariableExtractor} rules.
*
* @param ot ontology
* @return extracted rules
*/
@Override
public List<Rule> extract(OWLOntology ot) {
List<Rule> list = new ArrayList<>();
// list of predicates in ontology
List<String> ps = new ArrayList<>();
ps.add(TOPOBJ);
ps.add(TOPDATA);
OWLEntity e;
String op;
// check all declarations
for (OWLDeclarationAxiom a : ot.getAxioms(AxiomType.DECLARATION)) {
e = a.getEntity();
if (e.isOWLObjectProperty()) {
// if it is a object property declaration, add it to the list
// and also add it as subproperty of owl:topObjectProperty
op = getString(e.asOWLObjectProperty());
ps.add(op);
list.add(new SubPropertyOf(op, TOPOBJ));
} else if (e.isOWLDataProperty()) {
// if it is a data property declaration, add it to the list
// and also add it as subproperty of owl:topDataProperty
op = getString(e.asOWLDataProperty());
ps.add(op);
list.add(new SubPropertyOf(op, TOPDATA));
}
}
list.add(new PredicateVariable(ps));
return list;
}