/** * Determines if this ontology or its imports closure declares an entity i.e. contains a * declaration axiom for the specified entity. * * @param owlEntity The entity to be tested for * @param imports if INCLUDED, the imports closure is included. * @return {@code true} if the ontology or its imports closure contains a declaration for the * specified entity, otherwise {@code false}. */ default boolean isDeclared(OWLEntity owlEntity, Imports imports) { return imports.stream(this).anyMatch(o -> o.isDeclared(owlEntity)); }
@Nonnull public OWLOntology getHomeOntology(OWLEntity entity, Set<OWLOntology> ontologies) { return ontologies.stream() .filter(o -> o.containsEntityInSignature(entity)) .filter(o -> o.isDeclared(entity)) .findFirst().orElse(ontologies.iterator().next()); }
/** * Determines if this ontology or its imports closure declares an entity i.e. contains a * declaration axiom for the specified entity. * * @param owlEntity The entity to be tested for * @param imports if INCLUDED, the imports closure is included. * @return {@code true} if the ontology or its imports closure contains a declaration for the * specified entity, otherwise {@code false}. */ default boolean isDeclared(OWLEntity owlEntity, Imports imports) { return imports.stream(this).anyMatch(o -> o.isDeclared(owlEntity)); }
/** * Determines if this ontology or its imports closure declares an entity i.e. contains a * declaration axiom for the specified entity. * * @param owlEntity The entity to be tested for * @param imports if INCLUDED, the imports closure is included. * @return {@code true} if the ontology or its imports closure contains a declaration for the * specified entity, otherwise {@code false}. */ default boolean isDeclared(OWLEntity owlEntity, Imports imports) { return imports.stream(this).anyMatch(o -> o.isDeclared(owlEntity)); }
@Override public boolean isDeclared(OWLEntity owlEntity) { return withBooleanReadLock(() -> delegate.isDeclared(owlEntity)); }
private void collectTemporaryDeclarations(OWLAxiom axiom, List<OWLDeclarationAxiom> temporaryDeclarations) { for (OWLEntity e : getSignature(axiom)) { boolean referenced = getReasoner().getRootOntology().isDeclared(e, INCLUDED); if (!referenced) { temporaryDeclarations.add(getDeclaration(e)); } } }
private void collectTemporaryDeclarations(OWLAxiom axiom, List<OWLDeclarationAxiom> temporaryDeclarations) { for (OWLEntity e : getSignature(axiom)) { boolean referenced = getReasoner().getRootOntology().isDeclared(e, INCLUDED); if (!referenced) { temporaryDeclarations.add(getDeclaration(e)); } } }
private void collectTemporaryDeclarations(OWLAxiom axiom, List<OWLDeclarationAxiom> temporaryDeclarations) { for (OWLEntity e : getSignature(axiom)) { boolean referenced = getReasoner().getRootOntology().isDeclared(e, INCLUDED); if (!referenced) { temporaryDeclarations.add(getDeclaration(e)); } } }
public Object visit(OWLDatatypeDefinitionAxiom axiom) { // The datatype MUST be declared if (!getCurrentOntology().isDeclared(axiom.getDatatype(), true)) { profileViolations.add(new UseOfUndeclaredDatatype(getCurrentOntology(), axiom, axiom.getDatatype())); } return null; }
protected void undeclaredDatatype(OWLDatatype dt) { if (!dt.isTopDatatype() && !dt.isBuiltIn() && !getCurrentOntology().isDeclared(dt, Imports.INCLUDED)) { violations .add(new UseOfUndeclaredDatatype(getCurrentOntology(), getCurrentAxiom(), dt)); } }
protected void undeclaredDatatype(OWLDatatype dt) { if (!dt.isTopDatatype() && !dt.isBuiltIn() && !getCurrentOntology().isDeclared(dt, Imports.INCLUDED)) { violations .add(new UseOfUndeclaredDatatype(getCurrentOntology(), getCurrentAxiom(), dt)); } }
protected void undeclaredObjectProperty(OWLObjectProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add(new UseOfUndeclaredObjectProperty(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredClass(OWLClass ce) { if (!ce.isBuiltIn() && !ce.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(ce, INCLUDED)) { violations.add(new UseOfUndeclaredClass(getCurrentOntology(), getCurrentAxiom(), ce)); } }
protected void undeclaredDataProperty(OWLDataProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add( new UseOfUndeclaredDataProperty(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredObjectProperty(OWLObjectProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add(new UseOfUndeclaredObjectProperty(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredDataProperty(OWLDataProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add( new UseOfUndeclaredDataProperty(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredClass(OWLClass ce) { if (!ce.isBuiltIn() && !ce.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(ce, INCLUDED)) { violations.add(new UseOfUndeclaredClass(getCurrentOntology(), getCurrentAxiom(), ce)); } }
protected void undeclaredClass(OWLClass ce) { if (!ce.isBuiltIn() && !ce.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(ce, INCLUDED)) { violations.add(new UseOfUndeclaredClass(getCurrentOntology(), getCurrentAxiom(), ce)); } }
protected void undeclaredAnnotation(OWLAnnotationProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add(new UseOfUndeclaredAnnotationProperty(getCurrentOntology(), getCurrentAxiom(), getCurrentAnnotation(), property)); } }
protected void undeclaredAnnotation(OWLAnnotationProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add(new UseOfUndeclaredAnnotationProperty(getCurrentOntology(), getCurrentAxiom(), getCurrentAnnotation(), property)); } }