You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is actually known behavior which is by design.
There is no guarantee that any method of unattached (i.e. deleted) object will not throw an exception.
It is already deleted, so it has no connection with the graph.
Unlike OWL-API default impl, in ONT-API there is a dynamic object's state, which depends on graph and model's settings, it is true even for isBuiltIn parameter-property.
But for OWLEntity#isBuiltIn() it is better to make an exception:
there is an example of code in Protege where an entity is still in use even after its deletion (see org.protege.editor.owl.model.hierarchy.OWLAnnotationPropertyHierarchyProvider#handleChanges(...)).
Moreover - it is always possible to safely determine whether an entity is builtin even it is deleted.
The testcase:
OntologyManager m = OntManagers.createONT();
DataFactory df = m.getOWLDataFactory();
Ontology o = m.createOntology();
OWLAxiom a = df.getOWLDeclarationAxiom(df.getOWLAnnotationProperty("a"));
o.add(a);
OWLEntity e1 = o.signature().filter(AsOWLAnnotationProperty::isOWLAnnotationProperty)
.findFirst().orElseThrow(AssertionError::new);
Assert.assertFalse(e1.isBuiltIn());
o.remove(a);
Assert.assertFalse(e1.isBuiltIn());
The text was updated successfully, but these errors were encountered:
This is actually known behavior which is by design.
There is no guarantee that any method of unattached (i.e. deleted) object will not throw an exception.
It is already deleted, so it has no connection with the graph.
Unlike OWL-API default impl, in ONT-API there is a dynamic object's state, which depends on graph and model's settings, it is true even for isBuiltIn parameter-property.
But for
OWLEntity#isBuiltIn()
it is better to make an exception:there is an example of code in Protege where an entity is still in use even after its deletion (see
org.protege.editor.owl.model.hierarchy.OWLAnnotationPropertyHierarchyProvider#handleChanges(...)
).Moreover - it is always possible to safely determine whether an entity is builtin even it is deleted.
The testcase:
The text was updated successfully, but these errors were encountered: