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

Weird query evaluation behaviour #1112

Open
psiotwo opened this issue Apr 20, 2023 · 7 comments
Open

Weird query evaluation behaviour #1112

psiotwo opened this issue Apr 20, 2023 · 7 comments

Comments

@psiotwo
Copy link
Contributor

psiotwo commented Apr 20, 2023

Given the following input:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix obo: <http://purl.obolibrary.org/obo/> .
@prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> .

oboInOwl:hasDbXref a owl:AnnotationProperty .

obo:PR_Q9NTK1 a owl:Class .

[
    a owl:Axiom ;
    owl:annotatedSource obo:PR_Q9NTK1 ;
    owl:annotatedProperty oboInOwl:hasRelatedSynonym ;
    owl:annotatedTarget "C10orf10" ;
    oboInOwl:hasDbXref "UniProtKB:Q9NTK1" ;
] .

the presence of triple oboInOwl:hasDbXref a owl:AnnotationProperty . (T1) does affect the result of a simple query:

PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>

DELETE {
    ?concept oboInOwl:hasRelatedSynonym ?synonym .
} WHERE {
    ?concept oboInOwl:hasRelatedSynonym ?synonym
}

With T1 in, the query robot query -i input.ttl -u query.rq -o output.ttl evaluation materializes the reified axiom as :

obo:PR_Q9NTK1 a owl:Class ;
     oboInOwl:hasRelatedSynonym "C10orf10" .

Without T1, the query evaluation removes the related synonym.

I consider this behaviour inconsistent. Would expect the query to behave the same no matter whether hasDbXref is marked explicitely as AnnotationProperty or not.

@jamesaoverton
Copy link
Member

jamesaoverton commented Apr 20, 2023

In order to support various OWL formats and imports, ROBOT loads all input data through OWLAPI, and then sends it to Apache Jena if SPARQL operations are required.

My understanding is that your OWL Axiom Annotation implies that there's a triple to annotate, and your example is not well-formed as you presented it. So I guess that OWLAPI is adding the triple when input.ttl is loaded.

@jamesaoverton
Copy link
Member

Maybe I didn't quite understand. OWL Axiom Annotations require the predicate to be declared as an OWL Annotation Property, which is a common source of confusion that you can see elsewhere on this tracker.

@psiotwo
Copy link
Contributor Author

psiotwo commented Apr 20, 2023

Yes, I am aware of this - this seems just another example of a mismatch of the RDF-entailment over OWL. The query behaves

  1. intuitively for invalid OWL
  2. counterintuitively for valid OWL

@jamesaoverton
Copy link
Member

SPARQL UPDATE is an RDF operation, not an OWL operation. How do you suggest that ROBOT should handle it?

@psiotwo
Copy link
Contributor Author

psiotwo commented Apr 20, 2023

OWL entailment regime might help (e.g. for handling the reified axioms) as an opt-in switch - https://www.w3.org/TR/sparql11-entailment/#OWLRDFBSEntRegime.

@jamesaoverton
Copy link
Member

What tool would we use to implement that?

@psiotwo
Copy link
Contributor Author

psiotwo commented Apr 21, 2023

At some point I was working on https://github.com/kbss-cvut/owl2query - it is pretty dormant at present, but will try to look around for some other solutions and propose something here if any.

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