Re: update to SHACL-SPARQL (ISSUE-62)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I do not have such an algorithm.  However, binding determination is a part
of SPARQL, so every SPARQL system must have implemented this algorithm.  All
that is required would be to extract the algorithm from some open-source
SPARQL implementation.

It is not even necessary to implement this algorithm in SHACL.  The safety
net could only be in place for shapes, i.e., not for raw SPARQL.  (This
would require a minor change to
https://www.w3.org/2014/data-shapes/wiki/Shacl-sparql, which is in
progress.)  If templates are allowed, then the template writer would then be
required to (correctly) state whether the template produces bindings or not.

As far as what the safety binding should be, I don't think that I have ever
indicated that I would prefer only binding to nodes that have and outgoing
rdf:type triple.  My view is that the binding should be to all (non-literal)
nodes.

peter


On 06/02/2015 05:49 PM, Holger Knublauch wrote:
> Peter,
> 
> your email summarizes the situation well. I hope we can resolve ISSUE-1 
> (Inferencing) in the meeting this week so that we can make progress
> here.
> 
> With regards to a question that I raised yesterday, it seems that you
> would also prefer that the system would bind ?this with all resources
> with an rdf:type triple (my option 2), if the query is not binding.
> 
> Do you have an algorithm that determines whether an arbitrary SPARQL
> WHERE clause is binding a given variable (?this)?
> 
> Thanks, Holger
> 
> 
> On 6/3/2015 7:53, Peter F. Patel-Schneider wrote: The issue under
> discussion is how to handle scopes that are expressions. This kind of
> scope appears to be needed to handle certain examples, the bug example
> where a scope could be "all nodes that have a value of :reported for 
> property :status".
> 
> At first glance there does not appear to be any problem with such
> scopes. In a SPARQL solution you would just turn the scope into a bit of
> SPARQL, perhaps something like ?this :status :reported .
> 
> However, some expressions turn into SPARQL that doesn't "bind".  (SPARQL 
> requires binding so that it doesn't interate over the entire universe - 
> whether the requirement makes sense for SPARQL is out of scope here.) For
> example, you might want to have a scope something like "all nodes that 
> have no value for property :status".  This turns into something like 
> FILTER NOT EXISTS ( ?this :status ?that ) which is not binding.
> 
> What should be done for such scoping expressions?
> 
> My initial solution was to forbid them.  If anyone wanted to use such a 
> scope they would have to do something themselves to provide a binding. I
> also proposed a solution where a SHACL processor would automatically add 
> in extra SPARQL to provide a binding that would in essence iterate over
> all nodes in the graph.
> 
> Holger prefers requiring that expressions not be allowed to be scopes by 
> themselves but that they can only be used in conjunction with a class
> scope. This works well when there is a class that can be so used, as in
> 
> ex:MyShape sh:scopeClass :Bug ; sh:filterShape [ sh:property [
> sh:predicate :status; sh:hasValue :reported ] ] ; sh:constraint ....
> 
> However, when there is no such class he would use rdfs:Resource as the 
> "universal" class, as in
> 
> ex:MyShape sh:scopeClass rdfs:Resource ; sh:filterShape [ sh:property [
> sh:predicate :status; sh:hasValue :reported ] ] ; sh:constraint ....
> 
> That's still fine, except that to work correctly it requires RDFS
> inference. Otherwise rdfs:Resource is just another class, and one that
> need not appear at all an RDF graph that contains classes.
> 
> Holger would get around this by adding a special case for rdfs:Resource, 
> essentially adding in part of the RDFS semantics for this class.  I
> don't view this as a viable solution.  If rdfs:Resource is going to be
> used for this purpose then it should have its full RDFS meaning.  (Of
> course, if RDFS reasoning is going to be required for SHACL then
> rdfs:Resource will have its RDFS meaning.)
> 
> 
> My current preferred solution is to allow expresions as scopes and to 
> require that SHACL engines add in a binding expression when needed.
> This would allow for shapes like
> 
> ex:MyShape sh:scope [ sh:property [ sh:predicate :status; sh:cardinality
> 0 ] ] ; sh:constraint ....
> 
> This is independent of whether RDFS reasoning is going to be required
> for SHACL.  If RDFS reasoning is required, then non-binding scopes can be
> made binding by adding in ?this rdf:type rdfs:Resource If RDFS reasoning
> is not required, then the SPARQL specification would have to use a more
> complex binder, but implementations would be free to do something that is
> equivalent and maybe more efficient.
> 
> peter
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVeGI0AAoJECjN6+QThfjzI70H/iBTng/6SmVuJtJEiLgpSBK7
m6GadhMAsQr+poEkM+CBNoL72ty0ShFfSRY6xK6RoX6seqUnrXNPQr0cj7emIBkC
LW0MjOjQXJSFLY1ocOQsTV7S3rv0CMMV1noURNOfgormAFxL8JeGNzPJvh4DT7ek
dtf610kBZCGwEeAc9gFKXAK94BI9ywSdDU0s1cVbW9LOsHCfx1vxfKnZpUZB8rg8
InVTTF6GYy7JMlidE5wPa4y75EZZ8qRDPI7VaAVDk0AimWil085cngYjBChUFvWW
tBZrkKEIDiNawxF6r7SV7pFpYl8urD87xnDYkrVcaaxA0CK1Yv/5S98LzebsUA0=
=SCch
-----END PGP SIGNATURE-----

Received on Wednesday, 10 June 2015 16:14:11 UTC