-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ontology caches should use weak keys #984
Comments
I forgot the ontology file; here it is (had to append .txt to attach). |
Reading the log I had a sudden sense of dread, thinking signature caches might be static or some similar blunder, but I can't replicate the issue. Can this be replicated by you outside Scala? the only way I can imagine this happening is if some over eager optimization replaces the calls to createOWLOntologyManager() with the variable returned the first time. |
I originally saw this in Java when trying to update ROBOT's OWL API dependency to 4.5.18. The version change causes a few failing tests there. I'll try making a standalone Java app or an OWL API test. |
@ignazio1977 please take a look at #985. |
Ok, weird - it happens for OWLClass objects, not for the IRI of that same object. |
The signature caches are using the ontologies as object keys, which would be ok if they were using identity to find keys. Instead the default is equality, which for ontologies is based on the ontology id. |
Thanks @ignazio1977! |
If I load an ontology using an input stream, and then create an empty ontology, with the same ontology IRI, using a new instance of OWLOntologyManager, the empty ontology will return true when asked if it has a class from the first ontology in its signature.
This occurs with OWL API 4.5.18. In version 4.5.17, the bug was worse, in that it would occur also when the first ontology was created in code. With 4.5.18 I can only reproduce the error when I load the first ontology from an input stream.
Here is a Scala ammonite script demonstrating:
The text was updated successfully, but these errors were encountered: