ISSUE-170: SPARQL specifies a different reading for exists and blank nodes than needed for SHACL
exists blank nodes
SPARQL specifies a different reading for exists and blank nodes than needed for SHACL
- State:
- CLOSED
- Product:
- SHACL Spec
- Raised by:
- Peter Patel-Schneider
- Opened on:
- 2016-06-29
- Description:
- The SPARQL evaluation semantics at https://www.w3.org/TR/sparql11-query/#sparqlAlgebraEval specifies that EXISTS has a substitution semantics. The SPARQL definitions of sh:class and several other SHACL constructs use EXISTS.
This leads to incorrect results for value nodes that are blank nodes.
For example
ex:s1 rdf:type sh:Shape ;
sh:scopeClass ex:Person ;
sh:property [ sh:predicate sh:friend ;
sh:class ex:Person ] .
does not produce any violations on the graph
ex:Bill rdf:type ex:Person ;
ex:friend _:John .
What happens is that the evaluation of
SELECT $this ($this AS ?subject) $predicate (?value AS ?object)
WHERE {
$this $predicate ?value .
FILTER NOT EXISTS { ?value rdf:type/rdfs:subClassOf* $class } .
}
evaluates the EXISTS with ?value mapped to _:John. The substitution that underlies EXISTS results in
_:John rdf:type/rdfs:subClassOf* ex:Person
This triple is then matched against the graph and there is a match because _:John matches ex:Bill.
Either there needs to be an approved errata for SPARQL so that this match no longer happens, or the SHACL specification needs to say that it needs a different meaning for EXISTS, or the SPARQL definition of sh:class and the other SHACL constructs that use EXISTS need to be changed. - Related Actions Items:
- No related actions
- Related emails:
- ISSUE-170: EXISTS removed (from holger@topquadrant.com on 2017-01-12)
- Re: core remaining issues (from andy.seaborne@topquadrant.com on 2017-01-11)
- Proposed next steps (was: Re: core remaining issues) (from kontokostas@informatik.uni-leipzig.de on 2017-01-09)
- Re: core remaining issues (from holger@topquadrant.com on 2017-01-08)
- Re: core remaining issues (from kontokostas@informatik.uni-leipzig.de on 2017-01-06)
- Re: core remaining issues (from irene@topquadrant.com on 2017-01-06)
- core remaining issues (from kontokostas@informatik.uni-leipzig.de on 2017-01-06)
- Re: [Issue 170] Update on EXISTS (from andy.seaborne@topquadrant.com on 2016-12-11)
- [Issue 170] Update on EXISTS (from andy.seaborne@topquadrant.com on 2016-12-11)
- Re: Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-16)
- Re: Remaining issues with impact on the syntax (from kcoyle@kcoyle.net on 2016-11-15)
- Re: Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-15)
- Re: Remaining issues with impact on the syntax (from kcoyle@kcoyle.net on 2016-11-14)
- Re: Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-14)
- Re: Remaining issues with impact on the syntax (from eric@w3.org on 2016-11-13)
- Re: Remaining issues with impact on the syntax (from kcoyle@kcoyle.net on 2016-11-13)
- Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-11)
- Re: Please review the SHACL draft (was Re: Editing progress) (from holger@topquadrant.com on 2016-08-31)
- Re: shapes-ISSUE-172 (sh:nodeKind SPARQL definition): the sh:nodeKind SPARQL definition is unnecessarily complex [SHACL Spec] (from kcoyle@kcoyle.net on 2016-06-30)
- Re: shapes-ISSUE-172 (sh:nodeKind SPARQL definition): the sh:nodeKind SPARQL definition is unnecessarily complex [SHACL Spec] (from pfpschneider@gmail.com on 2016-06-29)
- Re: shapes-ISSUE-172 (sh:nodeKind SPARQL definition): the sh:nodeKind SPARQL definition is unnecessarily complex [SHACL Spec] (from kcoyle@kcoyle.net on 2016-06-29)
- Re: shapes-ISSUE-172 (sh:nodeKind SPARQL definition): the sh:nodeKind SPARQL definition is unnecessarily complex [SHACL Spec] (from pfpschneider@gmail.com on 2016-06-29)
- Re: shapes-ISSUE-172 (sh:nodeKind SPARQL definition): the sh:nodeKind SPARQL definition is unnecessarily complex [SHACL Spec] (from lehors@us.ibm.com on 2016-06-29)
- Re: shapes-ISSUE-172 (sh:nodeKind SPARQL definition): the sh:nodeKind SPARQL definition is unnecessarily complex [SHACL Spec] (from pfpschneider@gmail.com on 2016-06-29)
- shapes-ISSUE-170 (exists blank nodes): SPARQL specifies a different reading for exists and blank nodes than needed for SHACL (from sysbot+tracker@w3.org on 2016-06-29)
Related notes:
See also https://lists.w3.org/Archives/Public/public-rdf-shapes/2016Oct/0046.html
Holger Knublauch, 13 Oct 2016, 05:38:43RESOLUTION: Close ISSUE-170 since EXISTS has been removed, see https://lists.w3.org/Archives/Public/public-data-shapes-wg/2017Jan/0021.html
https://www.w3.org/2017/01/18-shapes-minutes.html
Display change log