Skip to content

Commit aa46419

Browse files
authored
SPARQL 1.0: variable introduced by GRAPH is not affecting inner OPTIONAL (#230)
1 parent 263dede commit aa46419

5 files changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@prefix : <http://example/> .
2+
3+
:s :p :o .
4+
:s2 :p <> .
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PREFIX : <http://example/>
2+
3+
SELECT ?g ?s {
4+
GRAPH ?g { ?s ?p ?o OPTIONAL { ?s ?p ?g } }
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@prefix : <http://example/> .
2+
@prefix rs: <http://www.w3.org/2001/sw/DataAccess/tests/result-set#> .
3+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
4+
5+
[] rdf:type rs:ResultSet ;
6+
rs:resultVariable "g" , "s" ;
7+
rs:solution [ rs:binding [ rs:value <data-optional.ttl> ;
8+
rs:variable "g"
9+
] ;
10+
rs:binding [ rs:value :s2 ;
11+
rs:variable "s"
12+
]
13+
] .

sparql/sparql10/graph/index.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,32 @@ <h2>
494494
</dd>
495495
</dl>
496496
</dd>
497+
<dt id='graph-optional'>
498+
<a class='testlink' href='#graph-optional'>
499+
graph-optional:
500+
</a>
501+
<span about='http://www.w3.org/2001/sw/DataAccess/tests/data-r2/graph/manifest#graph-optional' property='mf:name'>graph-optional</span>
502+
</dt>
503+
<dd inlist='true' property='mf:entry' resource='http://www.w3.org/2001/sw/DataAccess/tests/data-r2/graph/manifest#graph-optional' typeof='mf:QueryEvaluationTest'>
504+
<div property='rdfs:comment'>
505+
<p>The variable bound by the GRAPH operator is not used when evaluating a nested OPTIONAL</p>
506+
</div>
507+
<dl class='test-detail'>
508+
<dt>type</dt>
509+
<dd>mf:QueryEvaluationTest</dd>
510+
<dt>approval</dt>
511+
<dd property='mf:approval' resource=''></dd>
512+
<dt>action</dt>
513+
<dd>
514+
<dl class='test-detail'>
515+
</dl>
516+
</dd>
517+
<dt>result</dt>
518+
<dd>
519+
<a href='graph-optional.ttl' property='mf:result'>graph-optional.ttl</a>
520+
</dd>
521+
</dl>
522+
</dd>
497523
</dl>
498524
</div>
499525
<footer>

sparql/sparql10/graph/manifest.ttl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
:graph-not-exist
2727
:graph-variable-scope
2828
:graph-variable-join
29+
:graph-optional
2930
).
3031

3132
:dawg-graph-01 rdf:type mf:QueryEvaluationTest ;
@@ -227,3 +228,13 @@
227228
] ;
228229
mf:result <graph-variable-join.ttl> ;
229230
.
231+
:graph-optional rdf:type mf:QueryEvaluationTest ;
232+
mf:name "graph-optional" ;
233+
rdfs:comment "The variable bound by the GRAPH operator is not used when evaluating a nested OPTIONAL" ;
234+
mf:action
235+
[ qt:query <graph-optional.rq> ;
236+
qt:graphData <data-optional.ttl> ;
237+
qt:graphData <data-g1.ttl>
238+
] ;
239+
mf:result <graph-optional.ttl> ;
240+
.

0 commit comments

Comments
 (0)