本文整理汇总了Java中org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom.getSubProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OWLSubObjectPropertyOfAxiom.getSubProperty方法的具体用法?Java OWLSubObjectPropertyOfAxiom.getSubProperty怎么用?Java OWLSubObjectPropertyOfAxiom.getSubProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom
的用法示例。
在下文中一共展示了OWLSubObjectPropertyOfAxiom.getSubProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
OWLObjectPropertyExpression subPropertyExpression = axiom.getSubProperty();
if(subPropertyExpression.isAnonymous()){
sparql += objectVar + "<" + subPropertyExpression.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " .";
} else {
sparql += subjectVar + "<" + subPropertyExpression.asOWLObjectProperty().toStringID() + "> " + objectVar + " .";
}
OWLObjectPropertyExpression superPropertyExpression = axiom.getSuperProperty();
if(superPropertyExpression.isAnonymous()){
sparql += objectVar + "<" + superPropertyExpression.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " .";
} else {
sparql += subjectVar + "<" + superPropertyExpression.asOWLObjectProperty().toStringID() + "> " + objectVar + " .";
}
}
示例2: getAssertedSubProperties
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
/**
* Find all asserted direct sub properties of the parent property.
*
* @param parent
* @param g
* @return set
*/
public static Set<OWLObjectProperty> getAssertedSubProperties(OWLObjectProperty parent, OWLGraphWrapper g) {
Set<OWLObjectProperty> properties = new HashSet<OWLObjectProperty>();
for(OWLOntology ont : g.getAllOntologies()) {
Set<OWLSubObjectPropertyOfAxiom> axioms = ont.getObjectSubPropertyAxiomsForSuperProperty(parent);
for (OWLSubObjectPropertyOfAxiom axiom : axioms) {
OWLObjectPropertyExpression subProperty = axiom.getSubProperty();
if (subProperty instanceof OWLObjectProperty) {
properties.add(subProperty.asOWLObjectProperty());
}
}
}
return properties;
}
示例3: visit
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLSubObjectPropertyOfAxiom axiom) throws TranslationException {
Objects.requireNonNull(axiom);
OWLObjectPropertyExpression leftPropExpr = axiom.getSubProperty();
OWLObjectPropertyExpression rightPropExpr = axiom.getSuperProperty();
ComplexIntegerAxiom ret = getAxiomFactory().createSubObjectPropertyOfAxiom(
translateObjectPropertyExpression(leftPropExpr), translateObjectPropertyExpression(rightPropExpr),
translateAnnotations(axiom.getAnnotations()));
return Collections.singleton(ret);
}
示例4: transformOWLSubObjectPropertyOfAxiom
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
private Axiom transformOWLSubObjectPropertyOfAxiom(OWLSubObjectPropertyOfAxiom a) {
OWLObjectPropertyExpression sub = a.getSubProperty();
OWLObjectPropertyExpression sup = a.getSuperProperty();
Role lhs = new NamedRole(sub.asOWLObjectProperty().toStringID());
Role rhs = new NamedRole(sup.asOWLObjectProperty().toStringID());
return new RoleInclusion(new Role[]{lhs}, rhs);
}
示例5: transformOWLEquivalentObjectPropertiesAxiom
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入方法依赖的package包/类
private List<Axiom> transformOWLEquivalentObjectPropertiesAxiom(
OWLEquivalentObjectPropertiesAxiom a) {
List<Axiom> axioms = new ArrayList<Axiom>();
for (OWLSubObjectPropertyOfAxiom ax : a.asSubObjectPropertyOfAxioms()) {
OWLObjectPropertyExpression sub = ax.getSubProperty();
OWLObjectPropertyExpression sup = ax.getSuperProperty();
axioms.add(
new RoleInclusion(new NamedRole(sub.asOWLObjectProperty().toStringID()),
new NamedRole(sup.asOWLObjectProperty().toStringID()))
);
}
return axioms;
}