本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectPropertyExpression.asOWLObjectProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectPropertyExpression.asOWLObjectProperty方法的具体用法?Java OWLObjectPropertyExpression.asOWLObjectProperty怎么用?Java OWLObjectPropertyExpression.asOWLObjectProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLObjectPropertyExpression
的用法示例。
在下文中一共展示了OWLObjectPropertyExpression.asOWLObjectProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkPotentialRedundantSubClassAxioms
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
/**
* Check all classes for potential redundant subClass axioms of type:
* <pre>
* A SubClassOf R some B
* and
* A SubClassOf B
* </pre>
*
* @return list of axiom pairs
*/
public List<PotentialRedundant> checkPotentialRedundantSubClassAxioms() {
List<PotentialRedundant> result = new ArrayList<PotentialRedundant>();
for(OWLClass cls : graph.getAllOWLClasses()) {
Set<OWLSubClassOfAxiom> axioms = graph.getAllOWLSubClassOfAxiomsForSubClass(cls);
if (axioms.size() > 1) {
// only check sets with more than one axiom
for (OWLSubClassOfAxiom main : axioms) {
OWLClassExpression mainSuperClassCE = main.getSuperClass();
if (mainSuperClassCE.isAnonymous()) {
continue;
}
OWLClass mainSuperClass = mainSuperClassCE.asOWLClass();
for (OWLSubClassOfAxiom current : axioms) {
if (main == current) {
continue;
}
OWLClassExpression currentSuperClass = current.getSuperClass();
if (currentSuperClass.isAnonymous() && currentSuperClass instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom someValuesFrom = (OWLObjectSomeValuesFrom) currentSuperClass;
final OWLClassExpression filler = someValuesFrom.getFiller();
if (mainSuperClass.equals(someValuesFrom.getFiller())) {
final OWLObjectPropertyExpression property = someValuesFrom.getProperty();
final OWLClassExpression subClass = current.getSubClass();
final PotentialRedundant redundant = new PotentialRedundant(main, current, subClass.asOWLClass(), property.asOWLObjectProperty(), filler.asOWLClass());
result.add(redundant);
}
}
}
}
}
}
if (!result.isEmpty()) {
return result;
}
return null;
}
示例2: OWLQuantifiedProperty
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
public OWLQuantifiedProperty(OWLObjectPropertyExpression p, Quantifier q) {
if (p != null) {
if (p instanceof OWLObjectInverseOf) {
isInverseOf = true;
p = ((OWLObjectInverseOf)p).getInverse();
}
property = p.asOWLObjectProperty();
}
this.quantifier = q;
}
示例3: asOWLObjectProperty
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; //导入方法依赖的package包/类
private OWLObjectProperty asOWLObjectProperty(OWLObjectPropertyExpression expression) {
if (!(expression instanceof OWLObjectProperty)) {
throw new TranslationException("Object property expression cannot be translated: '" + expression + "'.");
}
return expression.asOWLObjectProperty();
}