Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Removing annotation properties can lead to duplicated axioms #1235

Open
gouttegd opened this issue Jan 14, 2025 · 0 comments
Open

Removing annotation properties can lead to duplicated axioms #1235

gouttegd opened this issue Jan 14, 2025 · 0 comments

Comments

@gouttegd
Copy link
Contributor

The remove command sometimes leads to duplicated axioms when producing OFN output.

This is best illustrated by an example. Let us consider the following minimal ontology:

Prefix(EX:=<http://example.org/EX_>)
Prefix(oboInOwl:=<http://www.geneontology.org/formats/oboInOwl#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)

Ontology(
Declaration(Class(EX:0001))
Declaration(Class(EX:0002))
Declaration(AnnotationProperty(oboInOwl:hasExactSynonym))
Declaration(AnnotationProperty(oboInOwl:is_inferred))

# Class: EX:0001
AnnotationAssertion(rdfs:label EX:0001 "my class")
AnnotationAssertion(oboInOwl:hasExactSynonym EX:0001 "my node")
SubClassOf(Annotation(oboInOwl:is_inferred "true"^^xsd:boolean) EX:0001 EX:0002)
)

Now let us remove all annotation properties except rdfs:label and oboInOwl:is_inferred:

$ robot remove --input ex1.ofn \
               --term rdfs:label --term oboInOwl:is_inferred --select complement \
               --select annotation-properties \
               --output ex1-filtered.ofn

This is the result (omitting prefix and entity declarations):

AnnotationAssertion(rdfs:label EX:0001 "my class")
SubClassOf(EX:0001 EX:0002)
SubClassOf(Annotation(oboInOwl:is_inferred "true"^^xsd:boolean) EX:0001 EX:0002)

The oboInOwl:hasExactSynonym annotation assertion axiom is removed as expected, but note how there are now two SubClassOf axioms: one with the oboInOwl:is_inferred annotation preserved (as expected), and one without that annotation.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant