@Override public DataPropertyAssertion createDataPropertyAssertion(String dp, ObjectConstant o, ValueConstant v) throws InconsistentOntologyException { return OntologyBuilderImpl.createDataPropertyAssertion(new DataPropertyExpressionImpl(dp), o, v); } };
@Override public boolean equals(Object obj) { if (obj == this) return true; if (obj instanceof ObjectPropertyExpressionImpl) { ObjectPropertyExpressionImpl other = (ObjectPropertyExpressionImpl) obj; return string.equals(other.string) && (isInverse == other.isInverse); } // the two types of properties share the same name space if (obj instanceof DataPropertyExpressionImpl) { DataPropertyExpressionImpl other = (DataPropertyExpressionImpl) obj; return (isInverse == false) && getName().equals(other.getName()); } return false; }
public static ABoxAssertionSupplier assertionSupplier(RDF rdfFactory) { return new ABoxAssertionSupplier() { @Override public ClassAssertion createClassAssertion(String c, ObjectConstant o) throws InconsistentOntologyException { return OntologyBuilderImpl.createClassAssertion(new ClassImpl(rdfFactory.createIRI(c)), o); } @Override public ObjectPropertyAssertion createObjectPropertyAssertion(String op, ObjectConstant o1, ObjectConstant o2) throws InconsistentOntologyException { return OntologyBuilderImpl.createObjectPropertyAssertion(new ObjectPropertyExpressionImpl(rdfFactory.createIRI(op)), o1, o2); } @Override public DataPropertyAssertion createDataPropertyAssertion(String dp, ObjectConstant o, ValueConstant v) throws InconsistentOntologyException { return OntologyBuilderImpl.createDataPropertyAssertion(new DataPropertyExpressionImpl(rdfFactory.createIRI(dp)), o, v); } }; }
@Override public boolean equals(Object obj) { if (obj == this) return true; if (obj instanceof ObjectPropertyExpressionImpl) { ObjectPropertyExpressionImpl other = (ObjectPropertyExpressionImpl) obj; return string.equals(other.string) && (isInverse == other.isInverse); } // the two types of properties share the same name space if (obj instanceof DataPropertyExpressionImpl) { DataPropertyExpressionImpl other = (DataPropertyExpressionImpl) obj; return (isInverse == false) && getName().equals(other.getName()); } return false; }
@Override public DataPropertyAssertion createDataPropertyAssertion(String dp, ObjectConstant o, ValueConstant v) throws InconsistentOntologyException { return OntologyBuilderImpl.createDataPropertyAssertion(new DataPropertyExpressionImpl(rdfFactory.createIRI(dp)), o, v); } };
private OntologyBuilderImpl(RDF rdfFactory) { classes = new OntologyCategoryImpl<>(s -> new ClassImpl(rdfFactory.createIRI(s)), CLASS_NOT_FOUND,""); objectProperties = new OntologyCategoryImpl<>(s -> new ObjectPropertyExpressionImpl(rdfFactory.createIRI(s)), OBJECT_PROPERTY_NOT_FOUND,""); dataProperties = new OntologyCategoryImpl<>(s -> new DataPropertyExpressionImpl(rdfFactory.createIRI(s)), DATA_PROPERTY_NOT_FOUND,""); annotationProperties = new OntologyCategoryImpl<>(s -> new AnnotationPropertyImpl(rdfFactory.createIRI(s)), ANNOTATION_PROPERTY_NOT_FOUND,""); classes.map.put(OWL.THING.getIRIString(), ClassImpl.owlThing); classes.map.put(OWL.NOTHING.getIRIString(), ClassImpl.owlNothing); objectProperties.map.put(OWL.TOP_OBJECT_PROPERTY.getIRIString(), ObjectPropertyExpressionImpl.owlTopObjectProperty); objectProperties.map.put(OWL.BOTTOM_OBJECT_PROPERTY.getIRIString(), ObjectPropertyExpressionImpl.owlBottomObjectProperty); dataProperties.map.put(OWL.TOP_DATA_PROPERTY.getIRIString(), DataPropertyExpressionImpl.owlTopDataProperty); dataProperties.map.put(OWL.BOTTOM_DATA_PROPERTY.getIRIString(), DataPropertyExpressionImpl.owlBottomDataProperty); this.rdfFactory = rdfFactory; }