- From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
- Date: Thu, 14 Jul 2016 09:33:48 -0700
- To: Daniel Hernández <daniel@degu.cl>, public-sparql-exists@w3.org
Let's try to keep issues clean. Issue-3 is about how blank nodes work when they are substituted. When to substitute is a different matter. peter On 07/14/2016 08:25 AM, Daniel Hernández wrote: > Hi all, > > With the same data that Andy proposed, another query is: > > Query 2: > --------------------- > PREFIX : <http://example/> > > SELECT * { > ?s :p ?o > FILTER EXISTS { SELECT ?p { ?s ?p 1 } } > } > > In this case ?s is not in-scope on the inner graph pattern. However, Virtuoso > and rdf4j > assume that ?s in the outer and inner graph patterns are correlated. That is, > the result is > > Outcome 1: > ----------------- > | s | p | o | > ================= > | _:s1 | :p | 1 | > ----------------- > > I think that substituting a variable that occurs in a basic graph pattern has > some problems > that are originated by the two roles that it has. First, it has the role of > naming a value from > the data. Second, it has the role of using a value from the current solution > mapping. > > In the report (http://arxiv.org/abs/1606.01441) we normalize a query before > applying > substitution: > > Query 3: > --------------------- > PREFIX : <http://example/> > > SELECT * { > ?s :p ?o > FILTER EXISTS { SELECT ?p { ?z ?p 1 FILTER (!(bound(?z) && bound(?s)) || ?z > = ?s) } } > } > > After the normalization, the inner graph pattern is equivalent with the > previous one, but > the variable ?s does not occur in a basic graph pattern, so it only has the > role of using values. > In this case substitution is safe respect to the issue of blank nodes. > > Daniel > > >
Received on Thursday, 14 July 2016 16:34:20 UTC