@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); } }
while (classIterator.hasNext()){ OClass next = classIterator.next(); if (!next.isTop() && !next.isBottom()) { Predicate entity = next.getPredicate(); if (nextEmptyEntity(entity)) { nEmptyConcepts++;
private void checkSignature(ClassExpression desc) { if (desc instanceof OClass) { OClass cl = (OClass) desc; if (!vocabulary.concepts.containsKey(cl.getName())) throw new IllegalArgumentException(CLASS_NOT_FOUND + desc); } else if (desc instanceof ObjectSomeValuesFrom) { checkSignature(((ObjectSomeValuesFrom) desc).getProperty()); } else { assert (desc instanceof DataSomeValuesFrom); checkSignature(((DataSomeValuesFrom) desc).getProperty()); } }
/** * Creates a class assertion * <p> * ClassAssertion := 'ClassAssertion' '(' axiomAnnotations Class Individual ')' * <p> * Implements rule [C4]: * - ignore (return null) if the class is top * - inconsistency if the class is bot */ @Override public ClassAssertion createClassAssertion(OClass ce, ObjectConstant object) throws InconsistentOntologyException { if (ce.isTop()) return null; if (ce.isBottom()) throw new InconsistentOntologyException(); return new ClassAssertionImpl(ce, object); }