@Override public void merge(ImmutableOntologyVocabulary v) { if (v instanceof OntologyVocabularyImpl) { OntologyVocabularyImpl vi = (OntologyVocabularyImpl)v; concepts.putAll(vi.concepts); objectProperties.putAll(vi.objectProperties); dataProperties.putAll(vi.dataProperties); annotationProperties.putAll(vi.annotationProperties); } else { for (OClass oc : v.getClasses()) if (!oc.isTop() && !oc.isBottom()) concepts.put(oc.getName(), oc); for (ObjectPropertyExpression ope : v.getObjectProperties()) if (!ope.isTop() && !ope.isBottom()) objectProperties.put(ope.getName(), ope); for (DataPropertyExpression dpe : v.getDataProperties()) if (!dpe.isTop() && !dpe.isBottom()) dataProperties.put(dpe.getName(), dpe); for (AnnotationProperty ap : v.getAnnotationProperties()) annotationProperties.put(ap.getName(), ap); } }
if (!next.isTop() && !next.isBottom()) { Predicate entity = next.getPredicate(); if (nextEmptyEntity(entity)) { nEmptyRoles++;
private void checkSignature(DataPropertyExpression prop) { if (!vocabulary.containsDataProperty(prop.getName())) throw new IllegalArgumentException(DATA_PROPERTY_NOT_FOUND + prop); }
@Override public boolean isTop() { return property.isTop(); } }
@Override public boolean isBottom() { return property.isBottom(); }
String propFunc = pfa.getName(); String strQuery = String.format(strQueryFunc, propFunc, propFunc);
/** * Creates a data property assertion * <p> * DataPropertyAssertion := 'DataPropertyAssertion' '(' axiomAnnotations * DataPropertyExpression sourceIndividual targetValue ')' * <p> * Implements rule [D4]: * - ignore (return null) if the property is top * - inconsistency if the property is bot */ @Override public DataPropertyAssertion createDataPropertyAssertion(DataPropertyExpression dpe, ObjectConstant o1, ValueConstant o2) throws InconsistentOntologyException { if (dpe.isTop()) return null; if (dpe.isBottom()) throw new InconsistentOntologyException(); return new DataPropertyAssertionImpl(dpe, o1, o2); }
/** * Normalizes and adds a data property range axiom * <p> * DataPropertyRange := 'DataPropertyRange' '(' axiomAnnotations DataPropertyExpression DataRange ')' * <p> * Implements rule [D3]: * - ignore if the property is bot or the range is rdfs:Literal (top datatype) * - inconsistency if the property is top but the range is not rdfs:Literal * * @throws InconsistentOntologyException */ @Override public void addDataPropertyRangeAxiom(DataPropertyRangeExpression range, Datatype datatype) throws InconsistentOntologyException { checkSignature(range); checkSignature(datatype); if (datatype.equals(DatatypeImpl.rdfsLiteral)) return; // otherwise the datatype is not top if (range.getProperty().isBottom()) return; if (range.getProperty().isTop()) throw new InconsistentOntologyException(); BinaryAxiom<DataRangeExpression> ax = new BinaryAxiomImpl<>(range, datatype); subDataRangeAxioms.add(ax); }