Skip to content

Commit ac62616

Browse files
committed
Consider bnode graph names in evaluation of Graph
1 parent 5615dfa commit ac62616

File tree

1 file changed

+41
-22
lines changed

1 file changed

+41
-22
lines changed

spec/index.html

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
div.defn p { margin-top: 1ex ; margin-bottom: 1.5ex ;}
108108
div.defn ul { margin-top: 1ex ; margin-bottom: 1.5ex ; }
109109
span.definedTerm {font-weight: bold;}
110+
div.indentedFormula { margin-left: 5ex ; margin-top: 2mm ; margin-bottom: 2mm ; }
110111

111112
div.grammarExtract
112113
{ border: thin solid #888888;
@@ -9448,8 +9449,6 @@ <h3>Basic Graph Patterns</h3>
94489449
<p>Write <var>Ω<sub>0</sub></var> for the multiset consisting of exactly the empty mapping
94499450
<var>μ<sub>0</sub></var>, with multiplicity 1. This is the join identity.</p>
94509451
<p>Write <var>μ</var>(<var>x</var>) for the solution mapping variable <var>x</var> to RDF term <var>t</var> : { (<var>x</var>, <var>t</var>) }.</p>
9451-
<p>Write <var>Ω</var>(<var>x</var>) for the multiset consisting of exactly <var>μ</var>(<var>?x</var>-&gt;<var>t</var>), that is, <code>{ { (x, t) } }</code>
9452-
with multiplicity 1.</p>
94539452
<div class="defn">
94549453
<p><b>Definition: <span id="defn_algCompatibleMapping">Compatible Mappings</span></b></p>
94559454
<p>Two solution mappings μ<sub>1</sub> and μ<sub>2</sub> are compatible if, for every
@@ -10288,9 +10287,8 @@ <h5>Sample</h5>
1028810287
<h3>Evaluation Semantics</h3>
1028910288
<p id="defn_eval">We define <a href="#defn_eval" class="evalFct">eval</a>(|D|(|G|), |A|) as the evaluation of an algebra expression |A| with
1029010289
respect to a <a href="#sparqlDataset">dataset</a> |D| having <a href="#defn_ActiveGraph">active graph</a> |G|. The active graph is initially the default
10291-
graph of |D|. Further symbols and notation used in the following definitions are:</p>
10290+
graph of |D|. Further symbols used in the following definitions are:</p>
1029210291
<ul>
10293-
<li>|D|[|i|] : Denotes the graph with IRI |i| in dataset |D|</li>
1029410292
<li>|P|, <var>P<sub>1</sub></var>, <var>P<sub>2</sub></var> : graph patterns</li>
1029510293
<li>|L| : a solution sequence</li>
1029610294
<li>|F| : an expression</li>
@@ -10344,25 +10342,46 @@ <h3>Evaluation Semantics</h3>
1034410342
</div>
1034510343
<div class="defn">
1034610344
<p><b>Definition: <span id="defn_evalGraph">Evaluation of Graph</span></b></p>
10347-
<pre class="code nohighlight">
10348-
if <var>IRI</var> is a graph name in <var>D</var>
10349-
<a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>G</var>), Graph(<var>IRI</var>,<var>P</var>) ) = <a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>D</var>[<var>IRI</var>]), <var>P</var> )
10350-
</pre>
10351-
<pre class="code nohighlight">
10352-
if <var>IRI</var> is not a graph name in <var>D</var>
10353-
<a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>G</var>), Graph(<var>IRI</var>,<var>P</var>) ) = the empty multiset
10354-
</pre>
10355-
<pre class="code nohighlight">
10356-
<a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>G</var>), Graph(<var>var</var>,<var>P</var>) ) =
10357-
Let <var>R</var> be the empty multiset
10358-
foreach IRI <var>i</var> in <var>D</var>
10359-
<var>R</var> := <a href="#defn_algUnion" class="algFct">Union</a>(<var>R</var>, <a href="#defn_algJoin" class="algFct">Join</a>( <a href="#defn_eval" class="evalFct">eval</a>(<var>D</var>(<var>D</var>[<var>i</var>]), <var>P</var>) , Ω(<var>var</var>-&gt;<var>i</var>) ) )
10360-
the result is <var>R</var>
10361-
</pre>
10345+
<p>For every |x| that is
10346+
an <a data-cite="RDF12-CONCEPTS#dfn-IRI">IRI</a> or
10347+
a <a href="#defn_QueryVariable">variable</a>,
10348+
<a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) )
10349+
is defined as follows:</p>
10350+
<ul>
10351+
<li>If |x| is an IRI
10352+
that is a <a data-cite="RDF12-CONCEPTS#dfn-graph-name">graph name</a> in |D|,
10353+
<div class="indentedFormula">
10354+
<a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) )
10355+
=
10356+
<a href="#defn_eval" class="evalFct">eval</a>( |D|(<var>G<sub>|x|</sub></var>), |P| ),
10357+
</div>
10358+
where <var>G<sub>|x|</sub></var> is the RDF graph of the named graph with name |x| in |D|.
10359+
</li>
10360+
<li>If |x| is an IRI
10361+
that is not a <a data-cite="RDF12-CONCEPTS#dfn-graph-name">graph name</a> in |D|,
10362+
<div class="indentedFormula">
10363+
<a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) )
10364+
is the empty multiset.
10365+
</div>
10366+
</li>
10367+
<li>If |x| is a variable,
10368+
<div class="indentedFormula">
10369+
<a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) )
10370+
=
10371+
<var>Ω</var>,
10372+
</div>
10373+
where <var>Ω</var> is the multiset of solution mappings produced by the following algorithm:
10374+
<pre class="code nohighlight" style="font-family: sans-serif;">
10375+
<var>Ω</var> := the empty multiset
10376+
foreach <a data-cite="RDF12-CONCEPTS#dfn-graph-name">graph name</a> <var>gn</var> in <var>D</var>
10377+
<var>G'</var> := the RDF graph of the named graph with name <var>gn</var> in <var>D</var>
10378+
<var>Ω'</var> := <a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>G'</var>), <var>P</var> )
10379+
<var>Ω</var> := <a href="#defn_algUnion" class="algFct">Union</a>( <var>Ω</var>, <a href="#defn_algJoin" class="algFct">Join</a>(<var>Ω'</var>, <var>μ</var>) ), where <var>μ</var> = {<var>x</var> → <var>gn</var>}
10380+
the result is <var>Ω</var>
10381+
</pre>
10382+
</li>
10383+
</ul>
1036210384
</div>
10363-
<p>The evaluation of graph uses the <a href="#defn_algUnion" class="algFct">Union</a> operator. The multiplicity of a
10364-
solution mapping is the sum of the multiplicities of that solution mapping in each <a href="#defn_algJoin" class="algFct">Join</a>
10365-
operation.</p>
1036610385
<div class="defn">
1036710386
<div id="defn_evalGroup">
1036810387
<b>Definition: Evaluation of Group</b>

0 commit comments

Comments
 (0)