private void checkSignature(AnnotationProperty prop) { if (!annotationProperties.contains(prop.getName())) throw new IllegalArgumentException(ANNOTATION_PROPERTY_NOT_FOUND + prop); }
@Override public Ontology build() { return new OntologyImpl(classes.getImmutableCopy(), objectProperties.getImmutableCopy(), ImmutableSet.copyOf(auxObjectProperties), dataProperties.getImmutableCopy(), annotationProperties.getImmutableCopy(), classAxioms.inclusions.build(), classAxioms.disjointness.build(), objectPropertyAxioms.inclusions.build(), objectPropertyAxioms.disjointness.build(), dataPropertyAxioms.inclusions.build(), dataPropertyAxioms.disjointness.build(), subDataRangeAxioms.build(), reflexiveObjectPropertyAxioms.build(), irreflexiveObjectPropertyAxioms.build(), functionalObjectPropertyAxioms.build(), functionalDataPropertyAxioms.build(), classAssertions.build(), objectPropertyAssertions.build(), dataPropertyAssertions.build(), annotationAssertions.build()); }
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; }
private void checkSignature(ClassExpression desc) { if (desc instanceof OClass) { OClass cl = (OClass) desc; if (!classes.contains(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()); } }
private void checkSignature(ClassExpression desc) { if (desc instanceof OClass) { OClass cl = (OClass) desc; if (!classes.contains(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()); } }
private void checkSignature(AnnotationProperty prop) { if (!annotationProperties.contains(prop.getName())) throw new IllegalArgumentException(ANNOTATION_PROPERTY_NOT_FOUND + prop); }
@Override public boolean contains(IRI iri) { return contains(iri.getIRIString()); }
private void checkSignature(DataPropertyExpression prop) { if (!dataProperties.contains(prop.getName())) throw new IllegalArgumentException(DATA_PROPERTY_NOT_FOUND + prop); }
private void checkSignature(DataPropertyExpression prop) { if (!dataProperties.contains(prop.getName())) throw new IllegalArgumentException(DATA_PROPERTY_NOT_FOUND + prop); }
private void checkSignature(ObjectPropertyExpression prop) { if (prop.isInverse()) prop = prop.getInverse(); if (!objectProperties.contains(prop.getName()) && !auxObjectProperties.contains(prop)) throw new IllegalArgumentException(OBJECT_PROPERTY_NOT_FOUND + prop); }
private void checkSignature(ObjectPropertyExpression prop) { if (prop.isInverse()) prop = prop.getInverse(); if (!objectProperties.contains(prop.getName()) && !auxObjectProperties.contains(prop)) throw new IllegalArgumentException(OBJECT_PROPERTY_NOT_FOUND + prop); }
@Override public T get(IRI iri) { return get(iri.getIRIString()); }
@Override public Ontology build() { return new OntologyImpl(classes.getImmutableCopy(), objectProperties.getImmutableCopy(), ImmutableSet.copyOf(auxObjectProperties), dataProperties.getImmutableCopy(), annotationProperties.getImmutableCopy(), classAxioms.inclusions.build(), classAxioms.disjointness.build(), objectPropertyAxioms.inclusions.build(), objectPropertyAxioms.disjointness.build(), dataPropertyAxioms.inclusions.build(), dataPropertyAxioms.disjointness.build(), subDataRangeAxioms.build(), reflexiveObjectPropertyAxioms.build(), irreflexiveObjectPropertyAxioms.build(), functionalObjectPropertyAxioms.build(), functionalDataPropertyAxioms.build(), classAssertions.build(), objectPropertyAssertions.build(), dataPropertyAssertions.build(), annotationAssertions.build()); }