@Override public void addToOntology() { OWLObjectProperty property = featurePool.getExclusiveProperty(":objectHasValueProperty"); OWLIndividual value = factory.getOWLNamedIndividual(":ObjectHasValue_Individual", pm); OWLObjectHasValue restriction = factory.getOWLObjectHasValue(property, value); OWLClass hasValue = featurePool.getExclusiveClass(":ObjectHasValue"); addAxiomToOntology(factory.getOWLSubClassOfAxiom(hasValue, restriction)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof OWLObjectHasValue)) { return false; } return getProperty().equals(((OWLObjectHasValue) obj).getProperty()); }
@Override protected int compareObjectOfSameType(OWLObject object) { OWLObjectHasValue other = (OWLObjectHasValue) object; int diff = getProperty().compareTo(other.getProperty()); if (diff != 0) { return diff; } return value.compareTo(other.getFiller()); }
/** * create axioms for class--objectproperty----individual relation. * * @param src * @param objprop * @param dest * @return */ private void getClass2ObjectProperty2IndividualAxioms(OWLClass src, OWLObjectProperty objprop, OWLIndividual dest) { // Set<OWLAxiom> tmpaxioms = new HashSet<OWLAxiom>(); OWLAxiom axiom; OWLObjectSomeValuesFrom owlObjectSomeValuesFrom; OWLObjectHasValue owlLObjectHasValue; OWLObjectMaxCardinality owlObjectMaxCardinality; OWLObjectOneOf owlObjectOneOf; // set domain and range // scoped domain if (editor.isGenerateDomainAxiom()) { owlLObjectHasValue = owlDataFactory.getOWLObjectHasValue(objprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlLObjectHasValue, src); domainAndRangeAxioms.add(axiom); owlObjectSomeValuesFrom = owlDataFactory.getOWLObjectSomeValuesFrom(objprop, owlDataFactory.getOWLThing()); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlObjectSomeValuesFrom, src); domainAndRangeAxioms.add(axiom); } // set existential restriction if (editor.isGenerateExistentialAxiom()) { owlObjectSomeValuesFrom = owlDataFactory.getOWLObjectSomeValuesFrom(objprop.getInverseProperty(), src); owlObjectOneOf = owlDataFactory.getOWLObjectOneOf(dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlObjectOneOf, owlObjectSomeValuesFrom); existentialAxioms.add(axiom); owlLObjectHasValue = owlDataFactory.getOWLObjectHasValue(objprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlLObjectHasValue); existentialAxioms.add(axiom); } // set cardinality restriction if (editor.isGenerateCardinalityAxiom()) { owlObjectMaxCardinality = owlDataFactory.getOWLObjectMaxCardinality(1, objprop, owlDataFactory.getOWLThing()); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlObjectMaxCardinality); cardinalityAxioms.add(axiom); owlObjectMaxCardinality = owlDataFactory.getOWLObjectMaxCardinality(1, objprop, owlDataFactory.getOWLThing()); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlObjectMaxCardinality); cardinalityAxioms.add(axiom); owlObjectOneOf = owlDataFactory.getOWLObjectOneOf(dest); owlObjectMaxCardinality = owlDataFactory.getOWLObjectMaxCardinality(1, objprop, owlObjectOneOf); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlObjectMaxCardinality); cardinalityAxioms.add(axiom); owlObjectOneOf = owlDataFactory.getOWLObjectOneOf(dest); owlObjectMaxCardinality = owlDataFactory.getOWLObjectMaxCardinality(1, objprop, owlObjectOneOf); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlObjectMaxCardinality); cardinalityAxioms.add(axiom); } // return tmpaxioms; }
public void visit(OWLObjectHasValue arg0) { notSupported(arg0); }
public void visit(OWLObjectHasValue object) { visitProperty(object.getProperty()); }
public OWLClassExpression visit(OWLObjectHasValue object) { throw new IllegalStateException("Internal error: object value restrictions should have been simplified."); }
public Boolean visit(OWLObjectHasValue object) { return Boolean.TRUE; }
public void visit(OWLObjectHasValue object) { m_hasNominals=true; visitProperty(object.getProperty()); }
public OWLClassExpression visit(OWLObjectHasValue d) { return m_factory.getOWLObjectHasValue(d.getProperty().getSimplified(),d.getValue()); }
public OWLClassExpression visit(OWLObjectHasValue d) { return m_factory.getOWLObjectComplementOf(getNNF(d)); }
public OWLClassExpression visit(OWLObjectHasValue d) { OWLObjectOneOf nominal=m_factory.getOWLObjectOneOf(d.getValue()); return m_factory.getOWLObjectSomeValuesFrom(d.getProperty().getSimplified(),nominal); }
public void visit(OWLObjectHasValue object) { throw new IllegalStateException("Internal error: invalid normal form."); }
@Override public OWLObjectHasValue visit(ElkObjectHasValue expression) { return owlFactory_.getOWLObjectHasValue( convert(expression.getProperty()), convert(expression.getFiller())); }
@Override public ElkObjectHasValue visit(OWLObjectHasValue owlObjectHasValue) { return CONVERTER.convert(owlObjectHasValue); }
@SuppressWarnings("static-method") public ElkObjectHasValue convert(OWLObjectHasValue owlObjectHasValue) { return new ElkObjectHasValueWrap<OWLObjectHasValue>(owlObjectHasValue); }
@Override public OWLObjectHasValue visit(OWLObjectHasValue ce) { return null; }
@Override public HandlerResult visit(OWLObjectHasValue ce) { return null; }
@Override public Boolean visit(OWLObjectHasValue classExpression) { return false; }
@Override public IntegerClassExpression visit(OWLObjectHasValue ce) { Objects.requireNonNull(ce); throw TranslationException.newUnsupportedTranslationException(ce); }
@Override public OWLClassExpression visit(OWLObjectHasValue ce) { return ce; }
@Override public O visit(OWLObjectHasValue ce) { return doDefault(ce); }
@Override public void visit(OWLObjectHasValue ce) { handleDefault(ce); }
@Override public void visit(OWLObjectHasValue ce) { type = CLASS_EXPRESSION_TYPE_INDEX_BASE + 7; }
@Override public OWLClassExpression visit(OWLObjectHasValue ce) { return ce.asSomeValuesFrom().accept(this); }
@Override public void visit(OWLObjectHasValue ce) { hashCode = primes[50]; hashCode = hashCode * MULT + ce.getProperty().hashCode(); hashCode = hashCode * MULT + ce.getFiller().hashCode(); }
@Override public Set<OWLClassExpression> visit(OWLObjectHasValue ce) { return toSet(ce); }