robot
robot copied to clipboard
`remove --axioms external` is removing transitivity axioms from in-base properties
When using robot remove --base-iri <BASE_IRI> --axioms external to remove axioms relative to “external” entities (entities that are not in the <BASE_IRI> namespace), all object properties within the base IRI namespace lose their transitive characteristic.
Minimal example to reproduce:
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Ontology(<http://example.org/untitled-ontology/>
Declaration(ObjectProperty(<http://example.org/UO_0001>))
Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/IAO_0000589>))
AnnotationAssertion(<http://purl.obolibrary.org/obo/IAO_0000589> <http://example.org/UO_0001> "example_property"@en)
TransitiveObjectProperty(<http://example.org/UO_0001>)
SubObjectPropertyOf(<http://example.org/UO_0001> owl:topObjectProperty)
)
Observe that the http://example.org/UO_0001 property is declared to be transitive.
Using the following command to remove any entity outside of the http://example.org/UO_ namespace:
$ robot remove -i input.ofn --base-iri http://example.org/UO_ --axioms external -o output.ofn
yields an output ontology where the http://example.org/UO_0001 property is still present (as expected since it belongs to the specified base IRI namespace) but is no longer transitive:
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Ontology(<http://example.org/untitled-ontology/>
Declaration(ObjectProperty(<http://example.org/UO_0001>))
Declaration(AnnotationProperty(<http://purl.obolibrary.org/obo/IAO_0000589>))
AnnotationAssertion(<http://purl.obolibrary.org/obo/IAO_0000589> <http://example.org/UO_0001> "example_property"@en)
SubObjectPropertyOf(<http://example.org/UO_0001> owl:topObjectProperty)
)
As explicitly confirmed by a robot diff:
$ robot diff --left input.ofn --right output.ofn
1 axioms in left ontology but not in right ontology:
- TransitiveObjectProperty(<http://example.org/UO_0001>)
0 axioms in right ontology but not in left ontology:
Observed with ROBOT-1.9.1, ROBOT-1.9.2, and with a locally built version from the tip of the master branch as of March 28.
I remember this issue from long ago, and I think I know how to fix it.
Ok this is constituted the last major issue on my ODK testing spree. It is not a disaster, but for ontologies that coin object property characteristics and axioms (including domain/range!), they will never be included in the base release until this is fixed.
I have put in hotfix for RO (https://github.com/oborel/obo-relations/pull/793) for now, and anyone who is harmed by that issue can feel free to do the same.