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:
  1. ISSUE-170: EXISTS removed (from holger@topquadrant.com on 2017-01-12)
  2. Re: core remaining issues (from andy.seaborne@topquadrant.com on 2017-01-11)
  3. Proposed next steps (was: Re: core remaining issues) (from kontokostas@informatik.uni-leipzig.de on 2017-01-09)
  4. Re: core remaining issues (from holger@topquadrant.com on 2017-01-08)
  5. Re: core remaining issues (from kontokostas@informatik.uni-leipzig.de on 2017-01-06)
  6. Re: core remaining issues (from irene@topquadrant.com on 2017-01-06)
  7. core remaining issues (from kontokostas@informatik.uni-leipzig.de on 2017-01-06)
  8. Re: [Issue 170] Update on EXISTS (from andy.seaborne@topquadrant.com on 2016-12-11)
  9. [Issue 170] Update on EXISTS (from andy.seaborne@topquadrant.com on 2016-12-11)
  10. Re: Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-16)
  11. Re: Remaining issues with impact on the syntax (from kcoyle@kcoyle.net on 2016-11-15)
  12. Re: Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-15)
  13. Re: Remaining issues with impact on the syntax (from kcoyle@kcoyle.net on 2016-11-14)
  14. Re: Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-14)
  15. Re: Remaining issues with impact on the syntax (from eric@w3.org on 2016-11-13)
  16. Re: Remaining issues with impact on the syntax (from kcoyle@kcoyle.net on 2016-11-13)
  17. Remaining issues with impact on the syntax (from holger@topquadrant.com on 2016-11-11)
  18. Re: Please review the SHACL draft (was Re: Editing progress) (from holger@topquadrant.com on 2016-08-31)
  19. 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)
  20. 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)
  21. 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)
  22. 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)
  23. 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)
  24. 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)
  25. 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:43

RESOLUTION: 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

Irene Polikoff, 10 Feb 2017, 00:03:23

Display change log ATOM feed


Chair, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: 170.html,v 1.1 2018/11/26 09:03:31 carine Exp $