本文整理汇总了Java中org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom类的典型用法代码示例。如果您正苦于以下问题:Java OWLSubObjectPropertyOfAxiom类的具体用法?Java OWLSubObjectPropertyOfAxiom怎么用?Java OWLSubObjectPropertyOfAxiom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLSubObjectPropertyOfAxiom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLSubObjectPropertyOfAxiom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: addAxiom
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
private void addAxiom(List<Rule> list, OWLSubObjectPropertyOfAxiom a) {
if (!(a.getSubProperty().isAnonymous() ||
a.getSuperProperty().isAnonymous())) {
String op1 = getString(a.getSubProperty());
String op2 = getString(a.getSuperProperty());
list.add(new SubPropertyOf(op1, op2));
}
}
示例3: 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;
}
示例4: isUnsupportedExtensionAxiom
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
protected static boolean isUnsupportedExtensionAxiom(OWLAxiom axiom) {
return axiom instanceof OWLSubObjectPropertyOfAxiom
|| axiom instanceof OWLTransitiveObjectPropertyAxiom
|| axiom instanceof OWLSubPropertyChainOfAxiom
|| axiom instanceof OWLFunctionalObjectPropertyAxiom
|| axiom instanceof OWLInverseFunctionalObjectPropertyAxiom
|| axiom instanceof SWRLRule;
}
示例5: visit
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
@Override
public T visit(OWLSubObjectPropertyOfAxiom axiom) {
throw new IllegalArgumentException(
OWLSubObjectPropertyOfAxiom.class.getSimpleName()
+ " cannot be converted to "
+ getTargetClass().getSimpleName());
}
示例6: getSuperProperties
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
public static Set<OWLObjectPropertyExpression> getSuperProperties(OWLObjectPropertyExpression prop, OWLOntology ont) {
Set<OWLObjectPropertyExpression> result = new HashSet<>();
Set<OWLSubObjectPropertyOfAxiom> axioms = ont.getObjectSubPropertyAxiomsForSubProperty(prop);
for (OWLSubPropertyAxiom<OWLObjectPropertyExpression> axiom : axioms) {
result.add(axiom.getSuperProperty());
}
return result;
}
示例7: getSubProperties
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
public static Set<OWLObjectPropertyExpression> getSubProperties(OWLObjectPropertyExpression prop, OWLOntology ont) {
Set<OWLObjectPropertyExpression> results = new HashSet<>();
Set<OWLSubObjectPropertyOfAxiom> axioms = ont.getObjectSubPropertyAxiomsForSuperProperty(prop);
for (OWLSubObjectPropertyOfAxiom axiom : axioms) {
results.add(axiom.getSubProperty());
}
return results;
}
示例8: getSuperPropertiesOf
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
/**
* returns parent properties of p in all ontologies
* @param p
* @return set of properties
*/
public Set<OWLObjectPropertyExpression> getSuperPropertiesOf(OWLObjectPropertyExpression p) {
Set<OWLObjectPropertyExpression> ps = new HashSet<OWLObjectPropertyExpression>();
for (OWLOntology ont : getAllOntologies()) {
for (OWLSubObjectPropertyOfAxiom a : ont.getObjectSubPropertyAxiomsForSubProperty(p)) {
ps.add(a.getSuperProperty());
}
}
return ps;
}
示例9: getSubPropertiesOf
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
/**
* Returns the direct child properties of <code>prop</code> in all ontologies.
* @param prop The <code>OWLObjectPropertyExpression</code> for which
* we want the direct sub-properties.
* @return A <code>Set</code> of <code>OWLObjectPropertyExpression</code>s
* that are the direct sub-properties of <code>prop</code>.
*
* @see #getSubPropertyClosureOf(OWLObjectPropertyExpression)
* @see #getSubPropertyReflexiveClosureOf(OWLObjectPropertyExpression)
*/
public Set<OWLObjectPropertyExpression> getSubPropertiesOf(
OWLObjectPropertyExpression prop) {
Set<OWLObjectPropertyExpression> subProps = new HashSet<OWLObjectPropertyExpression>();
for (OWLOntology ont : this.getAllOntologies()) {
for (OWLSubObjectPropertyOfAxiom axiom :
ont.getObjectSubPropertyAxiomsForSuperProperty(prop)) {
subProps.add(axiom.getSubProperty());
}
}
return subProps;
}
示例10: 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);
}
示例11: visit
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
@Override
public Void visit(OWLSubObjectPropertyOfAxiom axiom) {
long subProperty = getOrCreateNode(getIri(axiom.getSubProperty()));
long superProperty = getOrCreateNode(getIri(axiom.getSuperProperty()));
getOrCreateRelationship(subProperty, superProperty, OwlRelationships.RDFS_SUB_PROPERTY_OF);
return null;
}
示例12: visit
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
/**
* A utility method to process OWL <code>SubObjectPropertyOf(OPE1 OPE2)</code> axiom and produce
* inferred mapping assertions.
*/
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom)
{
/*
* Trace all the ancestors of the object property expression in the given OWL SubObjectPropertyOf axiom.
*/
Set<OWLSubPropertyAxiom<?>> ancestors = mOntology.traceAncestors(axiom.getSubProperty(), true);
for (OWLSubPropertyAxiom<?> ax : ancestors) {
/*
* Get all (copy) known mappings for the visited sub object property expression.
*/
OWLObjectPropertyExpression subProperty = (OWLObjectPropertyExpression) ax.getSubProperty();
subProperty.accept(this); // this call will produce (sub property) mSignature
Set<IMapping> subPropertyMappings = getMappingsForPropertyExpression();
if (subPropertyMappings.isEmpty()) {
continue;
}
/*
* Produce the "extra" mappings for the visited super object property expression as many as
* the known mappings in the sub object property expression.
*/
OWLObjectPropertyExpression superProperty = (OWLObjectPropertyExpression) ax.getSuperProperty();
superProperty.accept(this); // this call will produce (super property) mSignature and mIsInverse
URI superPropertySignature = mSignature;
for (IMapping subPropertyMapping : subPropertyMappings) {
IPropertyMapping pm = createPropertyMapping(superPropertySignature, subPropertyMapping, mIsInverse);
addInferredMapping(pm);
}
}
}
示例13: visit
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
hashCode = primes[27];
hashCode = hashCode * MULT + axiom.getSubProperty().hashCode();
hashCode = hashCode * MULT + axiom.getSuperProperty().hashCode();
hashCode = hashCode * MULT + axiom.getAnnotations().hashCode();
}
示例14: asSubObjectPropertyOfAxioms
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
@Override
public Set<OWLSubObjectPropertyOfAxiom> asSubObjectPropertyOfAxioms() {
Set<OWLSubObjectPropertyOfAxiom> axs = new HashSet<>();
axs.add(new OWLSubObjectPropertyOfAxiomImpl(getFirstProperty(),
getSecondProperty().getInverseProperty().getSimplified(),
NO_ANNOTATIONS));
axs.add(new OWLSubObjectPropertyOfAxiomImpl(getSecondProperty(),
getFirstProperty().getInverseProperty().getSimplified(),
NO_ANNOTATIONS));
return axs;
}
示例15: asSubPropertyAxioms
import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; //导入依赖的package包/类
@Nonnull
@Override
public Set<OWLSubObjectPropertyOfAxiom> asSubPropertyAxioms() {
Set<OWLSubObjectPropertyOfAxiom> result = new HashSet<>(5);
result.add(new OWLSubObjectPropertyOfAxiomImpl(getProperty(),
getProperty().getInverseProperty().getSimplified(),
NO_ANNOTATIONS));
result.add(new OWLSubObjectPropertyOfAxiomImpl(getProperty()
.getInverseProperty().getSimplified(), getProperty(),
NO_ANNOTATIONS));
return result;
}