-
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
OWLOntologyManager.copyOntology does not copy imports #480
Comments
I am not sure if this is a bug or not; for a deep copy I am more inclined Copying just the declarations is not always what is wanted; most of the The best approach might be a new copy mode, OntologyCopyWithImports, which A temporary workaround is to copy imports declarations and resolved
|
Yes, copying imports declarations would work. But the document itself remains without the import statements. Are the toCopy ontology and the DEEP-copying ontology considered equivalent (equals())? I would suggest to add imports to the DEEP copy. |
The javadoc for the method does not mention imports - but it does not mention annotations either and they are copied, so I think bug. However, note:
This is expected behaviour. The ontology copied to a new manager is only the specified ontology, not its imports closure. And imported ontologies are not loaded in a manager when the imports annotation is added - only when the ontology is loaded from storage. This is existing behaviour, to allow adding an import to an ontology without having to load the import (think importing very large ontologies; one doesn't want to do that just to add an import and save). |
On version 5, this test passes:
I'll try on 4. |
Imports declarations are ontology annotations. But we don't treat them the same as ontology annotations, and therefore they're not included in OWLOntology::annotations() Why, why why do we make life harder for ourselves? Bug. |
According the the OWL 2 FS doc they are distinguished from annotations. Also, adding/removing an import slurps in or removes axioms to/from the imports closure - annotations don't do this. |
But
https://www.w3.org/TR/owl-semantics/syntax.html Anyway, my bad - I should have added a test for that. |
Hang on, thats ancient OWL 1.... In OWL 2 imports declarations are distinct from ontology annotations... |
Imports declarations are things that are retrieved for an OWLOntology using
a different set of methods to those used to retrieve axioms.
#operationalSemantics
|
fixed on 4 and 5 |
Using the following code, the rdf import statement (<owl:imports rdf:resource="http://protege.stanford.edu/junitOntologies/testset/travel.owl"/>) is missing in the copied ontology when setting OntologyCopy to DEEP or SHALLOW. MOVE is the only setting that copies the statement over.
Furthermore, tOntology.getDirectImports() returns empty set even the rdf import statement exists in the copied ontology.
The sample ontology used in the test:
protegeSample.txt
The text was updated successfully, but these errors were encountered: