You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Let <var>Ψ</var> be a sequence of elements which may be either solution mappings or lists of RDF terms.</p>
9372
-
<p>Distinct(<var>Ψ</var>) is a sequence of elements that has the following properties.</p>
9373
-
<ol>
9374
-
<li>Every element in <var>Ψ</var> is contained in Distinct(<var>Ψ</var>).</li>
9375
-
<li>Every element in Distinct(<var>Ψ</var>) is contained in <var>Ψ</var>.</li>
9376
-
<li>Distinct(<var>Ψ</var>) is free of duplicates. That is, the element at the |i|-th position in Distinct(<var>Ψ</var>) is different from the element at the |j|-th position in Distinct(<var>Ψ</var>) for every two natural numbers |i| and |j| such that |i| ≠ |j|.
9377
-
</li>
9378
-
<li>For every two elements <var>e<sub>1</sub></var> and <var>e<sub>2</sub></var> in Distinct(<var>Ψ</var>), the relative order of their first occurrences in <var>Ψ</var> is preserved in Distinct(<var>Ψ</var>). That is, if <var>i<sub>1</sub></var> < <var>i<sub>2</sub></var>, then <var>j<sub>1</sub></var> < <var>j<sub>2</sub></var>, where
9379
-
<ul>
9380
-
<li><var>i<sub>1</sub></var> is the smallest natural number such that <var>e<sub>1</sub></var> is at the <var>i<sub>1</sub></var>-th position in <var>Ψ</var>,</li>
9381
-
<li><var>i<sub>2</sub></var> is the smallest natural number such that <var>e<sub>2</sub></var> is at the <var>i<sub>2</sub></var>-th position in <var>Ψ</var>,</li>
9382
-
<li><var>j<sub>1</sub></var> is the position of <var>e<sub>1</sub></var> in Distinct(<var>Ψ</var>), and</li>
9383
-
<li><var>j<sub>2</sub></var> is the position of <var>e<sub>2</sub></var> in Distinct(<var>Ψ</var>).</li>
9384
-
</ul>
9385
-
</li>
9386
-
</ol>
9371
+
<p>Let Ψ be a sequence of solution mappings. We define:</p>
9372
+
<p>Distinct(Ψ) = [ μ | μ in Ψ ]</p>
9373
+
<p>card[Distinct(Ψ)](μ) = 1</p>
9374
+
<p>The order of Distinct(Ψ) must preserve any ordering given by OrderBy.</p>
M(Ψ) = [ ListEval(exprlist, μ) | μ in Ψ ]<br>
9471
9459
F(Ψ) = func(M(Ψ), scalarvals), for non-<code>DISTINCT</code><br>
9472
-
F(Ψ) = func(Distinct(M(Ψ)), scalarvals), for <code>DISTINCT</code></p>
9460
+
F(Ψ) = func(Dedup(M(Ψ)), scalarvals), for <code>DISTINCT</code></p>
9461
+
<p>with Dedup(M(Ψ)) being an order-preserving, duplicate-free version of the sequence M(Ψ); that is, Dedup(M(Ψ)) is a sequence of RDF terms that has the following four properties.</p>
9462
+
<ol>
9463
+
<li>Every unique element in M(Ψ) is contained in Dedup(M(Ψ)).</li>
9464
+
<li>Every element in Dedup(M(Ψ)) is contained in M(Ψ).</li>
9465
+
<li>Dedup(M(Ψ)) is free of duplicates. That is, the element at the |i|-th position in Dedup(M(Ψ)) is not the same term as the element at the |j|-th position in Dedup(M(Ψ)) for every two natural numbers |i| and |j| such that |i| ≠ |j|.</li>
9466
+
<li>For any two elements <var>e<sub>1</sub></var> and <var>e<sub>2</sub></var> in Dedup(M(Ψ)), the relative order of their first occurrences in M(Ψ) is preserved in Dedup(M(Ψ)). That is, if <var>i<sub>1</sub></var> < <var>i<sub>2</sub></var>, then <var>j<sub>1</sub></var> < <var>j<sub>2</sub></var>, where
9467
+
<ul>
9468
+
<li><var>i<sub>1</sub></var> is the smallest natural number such that <var>e<sub>1</sub></var> is at the <var>i<sub>1</sub></var>-th position in M(Ψ),</li>
9469
+
<li><var>i<sub>2</sub></var> is the smallest natural number such that <var>e<sub>2</sub></var> is at the <var>i<sub>2</sub></var>-th position in M(Ψ),</li>
9470
+
<li><var>j<sub>1</sub></var> is the position of <var>e<sub>1</sub></var> in Dedup(M(Ψ)), and</li>
9471
+
<li><var>j<sub>2</sub></var> is the position of <var>e<sub>2</sub></var> in Dedup(M(Ψ)).</li>
9472
+
</ul>
9473
+
</li>
9474
+
</ol>
9475
+
9473
9476
<p><b>Special Case:</b> when <code>COUNT</code> is used with the expression
9474
9477
<code>*</code> the value of F will be the cardinality of the group solution sequence,
9475
-
<code>card[Ψ]</code>, or <code>card[Distinct(Ψ)]</code> if the <code>DISTINCT</code>
9478
+
<code>card[Ψ]</code>, or <code>card[Dedup(Ψ)]</code> if the <code>DISTINCT</code>
9476
9479
keyword is present.</p>
9477
9480
</div>
9478
9481
<p><i>scalarvals</i> are used to pass values to the underlying set function, bypassing
0 commit comments