/** * A utility method to process OWL <code>SymmetricObjectProperty(OPE)</code> axiom and produce * inferred mapping assertions. */ @Override public void visit(OWLSymmetricObjectPropertyAxiom axiom) { OWLObjectPropertyExpression ope = axiom.getProperty(); ope.accept(this); // this call will produce (object property) mSignature URI propertySignature = mSignature; /* * Get all (copy) known mappings for the visited object property expression. */ Set<IMapping> propertyMappings = getMappingsForPropertyExpression(); if (!propertyMappings.isEmpty()) { for (IMapping propertyMapping : propertyMappings) { /* * Create the inverse mapping that reflect the property's symmetry */ IPropertyMapping pm = createPropertyMapping(propertySignature, propertyMapping, true); // inverse = true addInferredMapping(pm); } } }
@Override public T visit(OWLSymmetricObjectPropertyAxiom axiom) { throw new IllegalArgumentException( OWLSymmetricObjectPropertyAxiom.class.getSimpleName() + " cannot be converted to " + getTargetClass().getSimpleName()); }
/** * true if c is symmetric in the graph * @param c * @return boolean */ public boolean getIsSymmetric(OWLObjectProperty c) { for(OWLOntology ont : getAllOntologies()) { Set<OWLSymmetricObjectPropertyAxiom> ax = ont.getSymmetricObjectPropertyAxioms(c); if (ax.isEmpty() == false) { return true; } } return false; }
/** * Symetric Role Asstertion <i>Sym(r)</i>is translated as: * </br></br> * :- r(X,Y), not r(Y,X).</br> * And thereby ruling out solutions with symetric paris (X,Y)and (Y,X). * * @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLSymmetricObjectPropertyAxiom) */ public void visit(OWLSymmetricObjectPropertyAxiom symmetricProperty) { writer.write("icons " + ASP2CoreSymbols.IMPLICATION); OWLObjectPropertyExpression property = symmetricProperty.getProperty(); String propertyName = mapper.getPredicateName(property.getNamedProperty()); String cVar = var.currentVar(); String nVar = var.nextVariable(); writer.write(String.format(" activated(%d), ", nConstraints++)); writer.write(propertyName); writer.write(ASP2CoreSymbols.BRACKET_OPEN); writer.write(cVar); writer.write(ASP2CoreSymbols.ARG_SEPERATOR); writer.write(nVar); writer.write(ASP2CoreSymbols.BRACKET_CLOSE); writer.write(ASP2CoreSymbols.CONJUNCTION); writer.write(ASP2CoreSymbols.NAF + "_"); writer.write(propertyName); writer.write(ASP2CoreSymbols.BRACKET_OPEN); writer.write(nVar); writer.write(ASP2CoreSymbols.ARG_SEPERATOR); writer.write(cVar); writer.write(ASP2CoreSymbols.BRACKET_CLOSE); writer.write(ASP2CoreSymbols.EOR); }
/** * Symetric Role Asstertion <i>Sym(r)</i>is translated as: * </br></br> * :- r(X,Y), not r(Y,X).</br> * And thereby ruling out solutions with symetric paris (X,Y)and (Y,X). * * @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLSymmetricObjectPropertyAxiom) */ public void visit(OWLSymmetricObjectPropertyAxiom symmetricProperty) { writer.write(ASP2CoreSymbols.IMPLICATION); OWLObjectPropertyExpression property = symmetricProperty.getProperty(); String propertyName = mapper.getPredicateName(property.getNamedProperty()); String cVar = var.currentVar(); String nVar = var.nextVariable(); writer.write(propertyName); writer.write(ASP2CoreSymbols.BRACKET_OPEN); writer.write(cVar); writer.write(ASP2CoreSymbols.ARG_SEPERATOR); writer.write(nVar); writer.write(ASP2CoreSymbols.BRACKET_CLOSE); writer.write(ASP2CoreSymbols.CONJUNCTION); writer.write(ASP2CoreSymbols.NAF); writer.write(ASP2CoreSymbols.SPACE); writer.write(propertyName); writer.write(ASP2CoreSymbols.BRACKET_OPEN); writer.write(nVar); writer.write(ASP2CoreSymbols.ARG_SEPERATOR); writer.write(cVar); writer.write(ASP2CoreSymbols.BRACKET_CLOSE); writer.write(ASP2CoreSymbols.EOR); }
@Override public void visit(OWLSymmetricObjectPropertyAxiom axiom) { String propertyURI = axiom.getProperty().asOWLObjectProperty().toStringID(); ParameterizedSparqlString query = new ParameterizedSparqlString("?s ?p ?o . ?o ?p ?s ."); query.setIri("p", propertyURI); sparql += query.toString(); }
@Override public OWLSymmetricObjectPropertyAxiom getAxiomWithoutAnnotations() { if (!isAnnotated()) { return this; } return new OWLSymmetricObjectPropertyAxiomImpl(getProperty(), NO_ANNOTATIONS); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } return obj instanceof OWLSymmetricObjectPropertyAxiom; }
public void visit(OWLSymmetricObjectPropertyAxiom axiom) { notSupported(axiom); }
public void visit(OWLSymmetricObjectPropertyAxiom axiom) { OWLObjectPropertyExpression objectProperty=axiom.getProperty(); addInclusion(objectProperty,objectProperty.getInverseProperty()); m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getProperty().getNamedProperty()); }
public Boolean visit(OWLSymmetricObjectPropertyAxiom axiom) { return reasoner.isSymmetric(axiom.getProperty()); }
public void visit(OWLSymmetricObjectPropertyAxiom axiom) { }
@Override public OWLSymmetricObjectPropertyAxiom visit( ElkSymmetricObjectPropertyAxiom axiom) { return owlFactory_.getOWLSymmetricObjectPropertyAxiom( convert(axiom.getProperty())); }
@SuppressWarnings("static-method") public ElkSymmetricObjectPropertyAxiom convert( OWLSymmetricObjectPropertyAxiom owlSymmetricObjectPropertyAxiom) { return new ElkSymmetricObjectPropertyAxiomWrap<OWLSymmetricObjectPropertyAxiom>( owlSymmetricObjectPropertyAxiom); }
@Override public ElkAxiom visit( OWLSymmetricObjectPropertyAxiom owlSymmetricObjectPropertyAxiom) { return CONVERTER.convert(owlSymmetricObjectPropertyAxiom); }
@Override public ElkObjectPropertyAxiom visit( OWLSymmetricObjectPropertyAxiom owlSymmetricObjectPropertyAxiom) { return CONVERTER.convert(owlSymmetricObjectPropertyAxiom); }
@Override public void visit(OWLSymmetricObjectPropertyAxiom axiom) { defaultVisit(axiom); }
@Override public OWLAxiom visit(OWLSymmetricObjectPropertyAxiom axiom) { return factory.getOWLSymmetricObjectPropertyAxiom(axiom.getProperty(), annotations); }
@Override public void visit(OWLSymmetricObjectPropertyAxiom axiom) { }
@Override public Boolean visit(OWLSymmetricObjectPropertyAxiom axiom) { return true; }
@Override public Boolean visit(OWLSymmetricObjectPropertyAxiom axiom) { return false; }
@Override public Boolean visit(OWLSymmetricObjectPropertyAxiom axiom) { Objects.requireNonNull(axiom); return add(this.df.getOWLSymmetricObjectPropertyAxiom(axiom.getProperty(), reg(axiom.getAnnotations()))); }
@Override public Boolean visit(OWLSymmetricObjectPropertyAxiom axiom) { Objects.requireNonNull(axiom); return add(this.df.getOWLSymmetricObjectPropertyAxiom(axiom.getProperty(), empty())); }
@Override public Set<ComplexIntegerAxiom> visit(OWLSymmetricObjectPropertyAxiom axiom) { Objects.requireNonNull(axiom); throw TranslationException.newUnsupportedAxiomException(axiom); }
@Override public O visit(OWLSymmetricObjectPropertyAxiom axiom) { return doDefault(axiom); }
@Override public void visit(OWLSymmetricObjectPropertyAxiom axiom) { type = AXIOM_TYPE_INDEX_BASE + axiom.getAxiomType().getIndex(); }
@Override public OWLAxiom visit(OWLSymmetricObjectPropertyAxiom axiom) { return axiom; }
@Override public void visit(OWLSymmetricObjectPropertyAxiom axiom) { hashCode = primes[31]; hashCode = hashCode * MULT + axiom.getProperty().hashCode(); hashCode = hashCode * MULT + axiom.getAnnotations().hashCode(); }
@Override public void visit(OWLSymmetricObjectPropertyAxiom axiom) { handleDefault(axiom); }
@Override public OWLSymmetricObjectPropertyAxiom getAnnotatedAxiom( Set<OWLAnnotation> annotations) { return new OWLSymmetricObjectPropertyAxiomImpl(getProperty(), mergeAnnos(annotations)); }
@Override public void visit(@Nonnull OWLSymmetricObjectPropertyAxiom axiom) { axiom.getProperty().accept(this); processAxiomAnnotations(axiom); }
public Object visit(OWLSymmetricObjectPropertyAxiom axiom) { profileViolations.add(new UseOfIllegalAxiom(getCurrentOntology(), axiom)); return null; }
public void visit(OWLSymmetricObjectPropertyAxiom arg0) { unusedAxiom(arg0); }
@Override protected OWLSymmetricObjectPropertyAxiom createAxiom(OWLObjectPropertyExpression propertyExpression, Set<OWLAnnotation> annotations, OWLDataFactory dataFactory) { return dataFactory.getOWLSymmetricObjectPropertyAxiom(propertyExpression, annotations); }
public void visit(OWLSymmetricObjectPropertyAxiom arg0) { }