|
107 | 107 | div.defn p { margin-top: 1ex ; margin-bottom: 1.5ex ;}
|
108 | 108 | div.defn ul { margin-top: 1ex ; margin-bottom: 1.5ex ; }
|
109 | 109 | span.definedTerm {font-weight: bold;}
|
| 110 | +div.indentedFormula { margin-left: 5ex ; margin-top: 2mm ; margin-bottom: 2mm ; } |
110 | 111 |
|
111 | 112 | div.grammarExtract
|
112 | 113 | { border: thin solid #888888;
|
@@ -9472,8 +9473,6 @@ <h3>Basic Graph Patterns</h3>
|
9472 | 9473 | <p>Write <var>Ω<sub>0</sub></var> for the multiset consisting of exactly the empty mapping
|
9473 | 9474 | <var>μ<sub>0</sub></var>, with multiplicity 1. This is the join identity.</p>
|
9474 | 9475 | <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>
|
9475 |
| - <p>Write <var>Ω</var>(<var>x</var>) for the multiset consisting of exactly <var>μ</var>(<var>?x</var>-><var>t</var>), that is, <code>{ { (x, t) } }</code> |
9476 |
| - with multiplicity 1.</p> |
9477 | 9476 | <div class="defn">
|
9478 | 9477 | <p><b>Definition: <span id="defn_algCompatibleMapping">Compatible Mappings</span></b></p>
|
9479 | 9478 | <p>Two solution mappings μ<sub>1</sub> and μ<sub>2</sub> are compatible if, for every
|
@@ -10312,9 +10311,8 @@ <h5>Sample</h5>
|
10312 | 10311 | <h3>Evaluation Semantics</h3>
|
10313 | 10312 | <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
|
10314 | 10313 | 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
|
10315 |
| - graph of |D|. Further symbols and notation used in the following definitions are:</p> |
| 10314 | + graph of |D|. Further symbols used in the following definitions are:</p> |
10316 | 10315 | <ul>
|
10317 |
| - <li>|D|[|i|] : Denotes the graph with IRI |i| in dataset |D|</li> |
10318 | 10316 | <li>|P|, <var>P<sub>1</sub></var>, <var>P<sub>2</sub></var> : graph patterns</li>
|
10319 | 10317 | <li>|L| : a solution sequence</li>
|
10320 | 10318 | <li>|F| : an expression</li>
|
@@ -10368,25 +10366,46 @@ <h3>Evaluation Semantics</h3>
|
10368 | 10366 | </div>
|
10369 | 10367 | <div class="defn">
|
10370 | 10368 | <p><b>Definition: <span id="defn_evalGraph">Evaluation of Graph</span></b></p>
|
10371 |
| - <pre class="code nohighlight"> |
10372 |
| -if <var>IRI</var> is a graph name in <var>D</var> |
10373 |
| - <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> ) |
10374 |
| - </pre> |
10375 |
| - <pre class="code nohighlight"> |
10376 |
| - if <var>IRI</var> is not a graph name in <var>D</var> |
10377 |
| - <a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>G</var>), Graph(<var>IRI</var>,<var>P</var>) ) = the empty multiset |
10378 |
| - </pre> |
10379 |
| - <pre class="code nohighlight"> |
10380 |
| -<a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>G</var>), Graph(<var>var</var>,<var>P</var>) ) = |
10381 |
| - Let <var>R</var> be the empty multiset |
10382 |
| - foreach IRI <var>i</var> in <var>D</var> |
10383 |
| - <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>-><var>i</var>) ) ) |
10384 |
| - the result is <var>R</var> |
10385 |
| - </pre> |
| 10369 | + <p>For every |x| that is |
| 10370 | + an <a data-cite="RDF12-CONCEPTS#dfn-IRI">IRI</a> or |
| 10371 | + a <a href="#defn_QueryVariable">variable</a>, |
| 10372 | + <a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) ) |
| 10373 | + is defined as follows:</p> |
| 10374 | + <ul> |
| 10375 | + <li>If |x| is an IRI |
| 10376 | + that is a <a data-cite="RDF12-CONCEPTS#dfn-graph-name">graph name</a> in |D|, |
| 10377 | + <div class="indentedFormula"> |
| 10378 | + <a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) ) |
| 10379 | + = |
| 10380 | + <a href="#defn_eval" class="evalFct">eval</a>( |D|(<var>G<sub>|x|</sub></var>), |P| ), |
| 10381 | + </div> |
| 10382 | + where <var>G<sub>|x|</sub></var> is the RDF graph of the named graph with name |x| in |D|. |
| 10383 | + </li> |
| 10384 | + <li>If |x| is an IRI |
| 10385 | + that is not a <a data-cite="RDF12-CONCEPTS#dfn-graph-name">graph name</a> in |D|, |
| 10386 | + <div class="indentedFormula"> |
| 10387 | + <a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) ) |
| 10388 | + is the empty multiset. |
| 10389 | + </div> |
| 10390 | + </li> |
| 10391 | + <li>If |x| is a variable, |
| 10392 | + <div class="indentedFormula"> |
| 10393 | + <a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), Graph(|x|, |P|) ) |
| 10394 | + = |
| 10395 | + <var>Ω</var>, |
| 10396 | + </div> |
| 10397 | + where <var>Ω</var> is the multiset of solution mappings produced by the following algorithm: |
| 10398 | + <pre class="code nohighlight" style="font-family: sans-serif;"> |
| 10399 | +<var>Ω</var> := the empty multiset |
| 10400 | +for each <a data-cite="RDF12-CONCEPTS#dfn-graph-name">graph name</a> <var>gn</var> in <var>D</var> (recall that a graph name may be an IRI or a blank node) |
| 10401 | + <var>G'</var> := the RDF graph of the named graph with name <var>gn</var> in <var>D</var> |
| 10402 | + <var>Ω'</var> := <a href="#defn_eval" class="evalFct">eval</a>( <var>D</var>(<var>G'</var>), <var>P</var> ) |
| 10403 | + <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>} |
| 10404 | +the result is <var>Ω</var> |
| 10405 | + </pre> |
| 10406 | + </li> |
| 10407 | + </ul> |
10386 | 10408 | </div>
|
10387 |
| - <p>The evaluation of graph uses the <a href="#defn_algUnion" class="algFct">Union</a> operator. The multiplicity of a |
10388 |
| - solution mapping is the sum of the multiplicities of that solution mapping in each <a href="#defn_algJoin" class="algFct">Join</a> |
10389 |
| - operation.</p> |
10390 | 10409 | <div class="defn">
|
10391 | 10410 | <div id="defn_evalGroup">
|
10392 | 10411 | <b>Definition: Evaluation of Group</b>
|
|
0 commit comments