Java 类org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom 实例源码

项目:OWL2SPARQL    文件:OWLAxiomToSPARQLConverter.java   
@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 + " .";
    }
}
项目:neo4j-sparql-extension-yars    文件:SubPropertyOfExtractor.java   
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));
    }
}
项目:minerva    文件:StartUpTool.java   
/**
 * 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;
}
项目:HermiT-android    文件:Reasoner.java   
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;
}
项目:elk-reasoner    文件:AbstractOwlAxiomConverterVisitor.java   
@Override
public T visit(OWLSubObjectPropertyOfAxiom axiom) {
    throw new IllegalArgumentException(
            OWLSubObjectPropertyOfAxiom.class.getSimpleName()
                    + " cannot be converted to "
                    + getTargetClass().getSimpleName());
}
项目:Hermit_1.3.8_android    文件:Reasoner.java   
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;
}
项目:owltools    文件:OwlHelper.java   
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;
}
项目:owltools    文件:OwlHelper.java   
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;
}
项目:owltools    文件:OWLGraphWrapperEdges.java   
/**
 * 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;
}
项目:owltools    文件:OWLGraphWrapperEdgesExtended.java   
/**
 * 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;
}
项目:jcel    文件:AxiomTranslator.java   
@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);
}
项目:neo4j-sparql-extension    文件:SubPropertyOfExtractor.java   
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));
    }
}
项目:SciGraph    文件:GraphOwlVisitor.java   
@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;
}
项目:semantika    文件:TMappingProcessor.java   
/**
 * 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);
      }
   }
}
项目:owlapi-gwt    文件:HashCode.java   
@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();
}
项目:owlapi-gwt    文件:OWLInverseObjectPropertiesAxiomImpl.java   
@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;
}
项目:owlapi-gwt    文件:OWLSymmetricObjectPropertyAxiomImpl.java   
@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;
}
项目:owlapi-gwt    文件:OWLSubObjectPropertyOfAxiomImpl.java   
@Override
public OWLSubObjectPropertyOfAxiom getAxiomWithoutAnnotations() {
    if (!isAnnotated()) {
        return this;
    }
    return new OWLSubObjectPropertyOfAxiomImpl(getSubProperty(),
            getSuperProperty(), NO_ANNOTATIONS);
}
项目:owlapi-gwt    文件:OWLSubObjectPropertyOfAxiomImpl.java   
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    return obj instanceof OWLSubObjectPropertyOfAxiom;
}
项目:ontology-core    文件:OWLImporter.java   
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);
}
项目:ontology-core    文件:OWLImporter.java   
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;
}
项目:snorocket    文件:DebugUtils.java   
public static String formatAxiom(OWLAxiom a, OWLOntology ont) {
    if (a instanceof OWLSubPropertyChainOfAxiom) {
        // TODO: implement
        return a.toString();
    } else if (a instanceof OWLSubObjectPropertyOfAxiom) {
        // TODO: implement
        return a.toString();
    } else if (a instanceof OWLSubClassOfAxiom) {
        OWLSubClassOfAxiom sc = (OWLSubClassOfAxiom) a;
        return formatClassExpression(sc.getSubClass(), ont) + " \u2286 "
                + formatClassExpression(sc.getSuperClass(), ont);
    } else if (a instanceof OWLEquivalentClassesAxiom) {
        OWLEquivalentClassesAxiom ec = (OWLEquivalentClassesAxiom) a;
        List<OWLClassExpression> ces = ec.getClassExpressionsAsList();
        StringBuilder sb = new StringBuilder();
        sb.append(formatClassExpression(ces.get(0), ont));
        for (int i = 1; i < ces.size(); i++) {
            sb.append(" = ");
            sb.append(formatClassExpression(ces.get(i), ont));
        }
        return sb.toString();
    } else if (a instanceof OWLDeclarationAxiom) {
        OWLDeclarationAxiom da = (OWLDeclarationAxiom) a;
        OWLEntity ent = da.getEntity();
        String name = (ent.isOWLClass()) ? getLabel(ent.asOWLClass(), ont)
                : ent.toString();
        return "init(" + name + ")";
    } else {
        return a.toString();
    }
}
项目:snorocket    文件:DebugUtils.java   
public static String formatAxiom(OWLAxiom a, OWLOntology ont) {
    if (a instanceof OWLSubPropertyChainOfAxiom) {
        // TODO: implement
        return a.toString();
    } else if (a instanceof OWLSubObjectPropertyOfAxiom) {
        // TODO: implement
        return a.toString();
    } else if (a instanceof OWLSubClassOfAxiom) {
        OWLSubClassOfAxiom sc = (OWLSubClassOfAxiom) a;
        return formatClassExpression(sc.getSubClass(), ont) + " \u2286 "
                + formatClassExpression(sc.getSuperClass(), ont);
    } else if (a instanceof OWLEquivalentClassesAxiom) {
        OWLEquivalentClassesAxiom ec = (OWLEquivalentClassesAxiom) a;
        List<OWLClassExpression> ces = ec.getClassExpressionsAsList();
        StringBuilder sb = new StringBuilder();
        sb.append(formatClassExpression(ces.get(0), ont));
        for (int i = 1; i < ces.size(); i++) {
            sb.append(" = ");
            sb.append(formatClassExpression(ces.get(i), ont));
        }
        return sb.toString();
    } else if (a instanceof OWLDeclarationAxiom) {
        OWLDeclarationAxiom da = (OWLDeclarationAxiom) a;
        OWLEntity ent = da.getEntity();
        String name = (ent.isOWLClass()) ? getLabel(ent.asOWLClass(), ont)
                : ent.toString();
        return "init(" + name + ")";
    } else {
        return a.toString();
    }
}
项目:neo4j-sparql-extension-yars    文件:SubPropertyOfExtractor.java   
private void addObjectAxioms(List<Rule> list,
        Set<OWLSubObjectPropertyOfAxiom> axs) {
    for (OWLSubObjectPropertyOfAxiom a : axs) {
        addAxiom(list, a);
    }
}
项目:jopa    文件:IntegrityConstraintParser.java   
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
    notSupported(axiom);
}
项目:HermiT-android    文件:OWLNormalization.java   
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
    if (!axiom.getSubProperty().isOWLBottomObjectProperty() && !axiom.getSuperProperty().isOWLTopObjectProperty())
        addInclusion(axiom.getSubProperty(),axiom.getSuperProperty());
    m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getSubProperty().getNamedProperty());
    m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getSuperProperty().getNamedProperty());
}
项目:HermiT-android    文件:EntailmentChecker.java   
public Boolean visit(OWLSubObjectPropertyOfAxiom axiom) {
    return reasoner.isSubObjectPropertyExpressionOf(axiom.getSubProperty(),axiom.getSuperProperty());
}
项目:HermiT-android    文件:EntailmentChecker.java   
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
}
项目:elk-reasoner    文件:OwlConverter.java   
@SuppressWarnings("static-method")
public ElkSubObjectPropertyOfAxiom convert(
        OWLSubObjectPropertyOfAxiom owlSubObjectPropertyOfAxiom) {
    return new ElkSubObjectPropertyOfAxiomWrap<OWLSubObjectPropertyOfAxiom>(
            owlSubObjectPropertyOfAxiom);
}
项目:elk-reasoner    文件:OwlAxiomConverterVisitor.java   
@Override
public ElkAxiom visit(
        OWLSubObjectPropertyOfAxiom owlSubObjectPropertyOfAxiom) {
    return CONVERTER.convert(owlSubObjectPropertyOfAxiom);
}
项目:elk-reasoner    文件:OwlObjectPropertyAxiomConverterVisitor.java   
@Override
public ElkObjectPropertyAxiom visit(
        OWLSubObjectPropertyOfAxiom owlSubObjectPropertyOfAxiom) {
    return CONVERTER.convert(owlSubObjectPropertyOfAxiom);
}
项目:elk-reasoner    文件:FailingOwlAxiomVisitor.java   
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
    defaultVisit(axiom);
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
    if (!axiom.getSubProperty().isOWLBottomObjectProperty() && !axiom.getSuperProperty().isOWLTopObjectProperty())
        addInclusion(axiom.getSubProperty(),axiom.getSuperProperty());
    m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getSubProperty().getNamedProperty());
    m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getSuperProperty().getNamedProperty());
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
public Boolean visit(OWLSubObjectPropertyOfAxiom axiom) {
    return reasoner.isSubObjectPropertyExpressionOf(axiom.getSubProperty(),axiom.getSuperProperty());
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
}
项目:owltools    文件:AxiomAnnotationTools.java   
@Override
public OWLAxiom visit(OWLSubObjectPropertyOfAxiom axiom) {
    return factory.getOWLSubObjectPropertyOfAxiom(axiom.getSubProperty(), axiom.getSuperProperty(), annotations);
}
项目:owltools    文件:CardinalityContraintsTools.java   
@Override
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(OWLSubObjectPropertyOfAxiom axiom) {
    if (!axiom.getSubProperty().isOWLBottomObjectProperty() && !axiom.getSuperProperty().isOWLTopObjectProperty())
        addInclusion(axiom.getSubProperty(),axiom.getSuperProperty());
    m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getSubProperty().getNamedProperty());
    m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getSuperProperty().getNamedProperty());
}
项目:Wolpertinger    文件:DebugTranslation.java   
public void visit(OWLSubObjectPropertyOfAxiom arg0) {
    throw new NotImplementedException();
}
项目:Wolpertinger    文件:NaiveTranslation.java   
public void visit(OWLSubObjectPropertyOfAxiom arg0) {
    throw new NotImplementedException();
}