Skip to content
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

REMOVE misses annotations to remove #1164

Open
jmkeil opened this issue Nov 21, 2023 · 3 comments
Open

REMOVE misses annotations to remove #1164

jmkeil opened this issue Nov 21, 2023 · 3 comments

Comments

@jmkeil
Copy link
Contributor

jmkeil commented Nov 21, 2023

I tried to work around #1163 with robot remove. In case of the small example in #1163 it worked out with the following command:

robot \
  merge \
    --input test-robot-xsd.ttl \
    --annotate-defined-by true \
  remove \
    --select "xsd:*" \
    --axioms annotation \
    --preserve-structure false \
    --output test-robot-xsd.merge+remove.ttl

However, in cases of a larger file (which I unfortunately can not share by now), it failed to remove some annotations. --preserve-structure false is needed to avoid the property hierarchy getting messed up. But the problem also occurs without --preserve-structure false.

From the result without remove command:

#################################################################
#    Datatypes
#################################################################

###  http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral
rdf:PlainLiteral rdfs:isDefinedBy <http://purl.obolibrary.org/obo/bfo.owl> .


###  http://www.w3.org/2000/01/rdf-schema#Literal
rdfs:Literal rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


###  http://www.w3.org/2001/XMLSchema#anyURI
xsd:anyURI rdfs:isDefinedBy <http://purl.obolibrary.org/obo/bfo.owl> .


###  http://www.w3.org/2001/XMLSchema#boolean
xsd:boolean rdfs:isDefinedBy <http://purl.obolibrary.org/obo/bfo.owl> .


###  http://www.w3.org/2001/XMLSchema#dateTime
xsd:dateTime rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


###  http://www.w3.org/2001/XMLSchema#decimal
xsd:decimal rdfs:isDefinedBy <http://example.org/my/ontology#> .


###  http://www.w3.org/2001/XMLSchema#double
xsd:double rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


###  http://www.w3.org/2001/XMLSchema#float
xsd:float rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


###  http://www.w3.org/2001/XMLSchema#integer
xsd:integer rdfs:isDefinedBy <http://example.org/my/ontology#> .


###  http://www.w3.org/2001/XMLSchema#nonNegativeInteger
xsd:nonNegativeInteger rdfs:isDefinedBy <http://example.org/my/ontology#> .


###  http://www.w3.org/2001/XMLSchema#string
xsd:string rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


#################################################################
#    Object Properties
#################################################################

From the result with remove command:

#################################################################
#    Datatypes
#################################################################

###  http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral
rdf:PlainLiteral rdfs:isDefinedBy <http://purl.obolibrary.org/obo/bfo.owl> .


###  http://www.w3.org/2000/01/rdf-schema#Literal
rdfs:Literal rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


###  http://www.w3.org/2001/XMLSchema#anyURI
xsd:anyURI rdfs:isDefinedBy <http://purl.obolibrary.org/obo/bfo.owl> .


###  http://www.w3.org/2001/XMLSchema#dateTime
xsd:dateTime rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


###  http://www.w3.org/2001/XMLSchema#string
xsd:string rdfs:isDefinedBy <http://purl.obolibrary.org/obo/iao.owl> .


#################################################################
#    Object Properties
#################################################################

I would have expected, that the annotations for xsd:anyURI, xsd:dateTime and xsd:string would be removed too. Any idea what could be the reason?

An workaround could be the use of SPARQL UPDATE, but that is not nice, as it would require an additional query file and an additional convert command, to preserve the OWL API serialization.

@jamesaoverton
Copy link
Member

To clarify: In the larger file you mention, are these XSD datatypes used in the range, domain, or other logic of some terms?

@jmkeil
Copy link
Contributor Author

jmkeil commented Nov 30, 2023

From the above datatypes these are used in some logic:

xsd:anyURI
xsd:boolean
xsd:dateTime
xsd:decimal
xsd:double
xsd:float
xsd:integer
xsd:nonNegativeInteger
xsd:string

And these are not used in some logic:

rdfs:Literal
rdf:PlainLiteral

@jamesaoverton
Copy link
Member

Thanks! I was hoping that list would help clarify the problem, but it doesn't help me. Hopefully a fix for #1163 will mean this problem is avoided.

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

No branches or pull requests

2 participants