/** * @param p * @return type-level form of relation */ private OWLObjectPropertyExpression trTypeLevel( OWLObjectPropertyExpression p) { if (!this.isTranslateObjectProperty) { return p; } if (p instanceof OWLObjectInverseOf) { OWLObjectPropertyExpression p2 = trTypeLevel(((OWLObjectInverseOf)p).getInverse()); return getOWLDataFactory().getOWLObjectInverseOf(p2); } else { instanceLevelRelations.add((OWLObjectProperty)p); IRI iri = ((OWLObjectProperty) p).getIRI(); return trTypeLevel(iri); } }
protected Map<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>> buildInversePropertiesMap(Collection<OWLObjectPropertyExpression[]> simpleObjectPropertyInclusions) { Map<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>> inversePropertiesMap=new HashMap<OWLObjectPropertyExpression,Set<OWLObjectPropertyExpression>>(); for (OWLObjectPropertyExpression[] inclusion : simpleObjectPropertyInclusions) if (inclusion[1] instanceof OWLObjectInverseOf) { Set<OWLObjectPropertyExpression> inverseProperties=inversePropertiesMap.get(inclusion[0]); if (inverseProperties==null) inverseProperties=new HashSet<OWLObjectPropertyExpression>(); inverseProperties.add(inclusion[1].getInverseProperty().getSimplified()); inversePropertiesMap.put(inclusion[0],inverseProperties); } return inversePropertiesMap; }
protected static Role getRole(OWLObjectPropertyExpression objectPropertyExpression) { objectPropertyExpression=objectPropertyExpression.getSimplified(); if (objectPropertyExpression instanceof OWLObjectProperty) return AtomicRole.create(((OWLObjectProperty)objectPropertyExpression).getIRI().toString()); else if (objectPropertyExpression instanceof OWLObjectInverseOf) { OWLObjectPropertyExpression internal=((OWLObjectInverseOf)objectPropertyExpression).getInverse(); if (!(internal instanceof OWLObjectProperty)) throw new IllegalStateException("Internal error: invalid normal form."); return AtomicRole.create(((OWLObjectProperty)internal).getIRI().toString()).getInverse(); } else throw new IllegalStateException("Internal error: invalid normal form."); }
private BindingSet unify(OWLObjectPropertyExpression p, OWLObjectPropertyExpression template, Set<IRI> vars) { if (p instanceof OWLObjectProperty && template instanceof OWLObjectProperty) { return unify(((OWLObjectProperty) p).getIRI(), ((OWLObjectProperty) template).getIRI(), vars); } if (p instanceof OWLObjectInverseOf && template instanceof OWLObjectInverseOf) { return unify(((OWLObjectInverseOf)p).getInverse(), ((OWLObjectInverseOf)template).getInverseProperty(), vars); } return null; }
private OWLObjectPropertyExpression replaceVariables( OWLObjectPropertyExpression p, BindingSet bset) { if (p instanceof OWLObjectProperty) { IRI y = replaceIRI(((OWLObjectProperty)p).getIRI(), bset); return getOWLDataFactory().getOWLObjectProperty(y); } if (p instanceof OWLObjectInverseOf) { return getOWLDataFactory().getOWLObjectInverseOf( replaceVariables(((OWLObjectInverseOf)p).getInverse(), bset)); } return null; }
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; }
public void visit(OWLSubPropertyChainOfAxiom arg0) { // TODO Auto-generated method stub String superPropertyName = null; OWLObjectPropertyExpression superPropertyExpression = arg0.getSuperProperty(); int counter = 1; writer.print("icons :-"); for (OWLObjectPropertyExpression subPropertyExpression : arg0.getPropertyChain()) { int firstCounter = counter; int secondCounter = ++counter; String subPropertyName = null; if (subPropertyExpression instanceof OWLObjectInverseOf) { int temp = firstCounter; firstCounter = secondCounter; secondCounter = temp; subPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) subPropertyExpression).getInverse().asOWLObjectProperty()); } else { subPropertyName = mapper.getPredicateName(subPropertyExpression.asOWLObjectProperty()); } writer.print(String.format("%s(X%d,X%d),", subPropertyName, firstCounter, secondCounter)); } if (superPropertyExpression instanceof OWLObjectInverseOf) { superPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) superPropertyExpression).getInverse().asOWLObjectProperty()); writer.print(String.format("not %s(X%d,X%d).", superPropertyName, counter, 1)); } else { superPropertyName = mapper.getPredicateName(arg0.getSuperProperty().asOWLObjectProperty()); writer.print(String.format("not %s(X%d,X%d).", superPropertyName, 1, counter)); } }
public void visit(OWLSubPropertyChainOfAxiom arg0) { // TODO Auto-generated method stub String superPropertyName = null; OWLObjectPropertyExpression superPropertyExpression = arg0.getSuperProperty(); int counter = 1; writer.print(":-"); for (OWLObjectPropertyExpression subPropertyExpression : arg0.getPropertyChain()) { int firstCounter = counter; int secondCounter = ++counter; String subPropertyName = null; if (subPropertyExpression instanceof OWLObjectInverseOf) { int temp = firstCounter; firstCounter = secondCounter; secondCounter = temp; subPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) subPropertyExpression).getInverse().asOWLObjectProperty()); } else { subPropertyName = mapper.getPredicateName(subPropertyExpression.asOWLObjectProperty()); } writer.print(String.format("%s(X%d,X%d),", subPropertyName, firstCounter, secondCounter)); } if (superPropertyExpression instanceof OWLObjectInverseOf) { superPropertyName = mapper.getPredicateName(((OWLObjectInverseOf) superPropertyExpression).getInverse().asOWLObjectProperty()); writer.print(String.format("not %s(X%d,X%d).", superPropertyName, counter, 1)); } else { superPropertyName = mapper.getPredicateName(arg0.getSuperProperty().asOWLObjectProperty()); writer.print(String.format("not %s(X%d,X%d).", superPropertyName, 1, counter)); } }
@Override public IntegerObjectPropertyExpression visit(OWLObjectInverseOf property) { Objects.requireNonNull(property); IntegerObjectPropertyExpression propExpr = property.getInverse().accept(this); IntegerObjectPropertyExpression ret; if (propExpr instanceof IntegerObjectProperty) { ret = getDataTypeFactory().createObjectInverseOf((IntegerObjectProperty) propExpr); } else if (propExpr instanceof IntegerObjectInverseOf) { ret = ((IntegerObjectInverseOf) propExpr).getInverse(); } else { throw new IllegalArgumentException("Object property expression cannot be translated: " + property); } return ret; }
private OWLSubClassOfAxiom asSubClassOfAxiom(OWLObjectPropertyRangeAxiom axiom) { OWLObjectInverseOf inverseExpression = mOwlDataFactory.getOWLObjectInverseOf(axiom.getProperty()); OWLClassExpression classExpression = axiom.getRange(); OWLClassExpression sub = mOwlDataFactory.getOWLObjectSomeValuesFrom(inverseExpression, mOwlDataFactory.getOWLThing()); return mOwlDataFactory.getOWLSubClassOfAxiom(sub, classExpression); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof OWLObjectInverseOf)) { return false; } return ((OWLObjectInverseOf) obj).getInverse().equals(inverseProperty); }
@Override public OWLObjectPropertyAssertionAxiom getSimplified() { if (!getProperty().isAnonymous()) { return this; } else { OWLObjectInverseOf property = (OWLObjectInverseOf) getProperty(); OWLObjectPropertyExpression invProp = property.getInverse(); return new OWLObjectPropertyAssertionAxiomImpl(getObject(), invProp, getSubject(), NO_ANNOTATIONS); } }
@Override public OWLObjectInverseOf visit(ElkObjectInverseOf expression) { return owlFactory_ .getOWLObjectInverseOf(convert(expression.getObjectProperty())); }
@Override public ElkObjectPropertyExpression visit(OWLObjectInverseOf property) { return property.getInverse().accept(OWL_OBJECT_PROPERTRY_CONVERTER_); }
@Override public ElkObjectPropertyExpression visit(OWLObjectInverseOf property) { return property.getInverse().accept(OWL_OBJECT_INVERSE_OF_CONVERTER_); }
public void visit(OWLObjectInverseOf arg0) { }
@Override public Boolean visit(OWLObjectInverseOf propertyExpression) { return false; }
@Override public void visit(OWLObjectInverseOf expr) { mIsInverse = true; mSignature = expr.getInverse().asOWLObjectProperty().getIRI().toURI(); }
private OWLSubClassOfAxiom asSubClassOfAxiom(OWLObjectPropertyRangeAxiom axiom) { OWLObjectInverseOf inv = sOwlDataFactory.getOWLObjectInverseOf(axiom.getProperty()); OWLClassExpression sub = sOwlDataFactory.getOWLObjectSomeValuesFrom(inv, sOwlDataFactory.getOWLThing()); return sOwlDataFactory.getOWLSubClassOfAxiom(sub, axiom.getRange()); }
@Override public O visit(OWLObjectInverseOf property) { return doDefault(property); }
@Override public void visit(OWLObjectInverseOf property) { handleDefault(property); }
@Override public void visit(OWLObjectInverseOf property) { type = OBJECT_PROPERTY_INVERSE; }
@Override public void visit(OWLObjectInverseOf property) { hashCode = primes[57]; hashCode = hashCode * MULT + property.getInverse().hashCode(); }
@Override public void visit(@Nonnull OWLObjectInverseOf property) { property.getInverse().accept(this); }
@Override protected int compareObjectOfSameType(OWLObject object) { return inverseProperty.compareTo(((OWLObjectInverseOf) object) .getInverse()); }
public Object visit(OWLObjectInverseOf property) { profileViolations.add(new UseOfObjectPropertyInverse(getCurrentOntology(), getCurrentAxiom(), property)); return null; }
@Override protected void writeObject(OWLObjectInverseOf object, BinaryOWLOutputStream outputStream) throws IOException { outputStream.writeOWLObject(object.getInverse()); }
@Override protected OWLObjectInverseOf readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException { OWLObjectPropertyExpression inverse = inputStream.readOWLObject(); return inputStream.getDataFactory().getOWLObjectInverseOf(inverse); }
public void visit(OWLObjectInverseOf arg0) { // TODO Auto-generated method stub }