Skip to content

Commit 3250785

Browse files
authored
Merge pull request #135 from w3c/MoveFlattenAndCard
Moves the definition of Flatten(..) and Card(..)
2 parents 826c5d9 + bb1812d commit 3250785

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

spec/index.html

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9697,20 +9697,6 @@ <h4>Aggregate Algebra</h4>
96979697
..., agg<sub>n</sub>→val<sub>n</sub> | key in K and key→val<sub>i</sub> in
96989698
S<sub>i</sub> for each 1 &le; i &le; n }</p>
96999699
</div>
9700-
<p>Flatten is a function which is used to collapse a sequence of lists into a single list.
9701-
For example, [(1,&nbsp;2), (3,&nbsp;4)] becomes (1, 2, 3, 4).</p>
9702-
<div class="defn">
9703-
<p><b>Definition: <span id="defn_Flatten">Flatten</span></b></p>
9704-
<p>The Flatten(S) function takes a sequence S of lists,
9705-
i.e., S = [L<sub>1</sub>, L<sub>2</sub>, ..., L<sub>m</sub>]
9706-
where every L<sub>i</sub> is a list,
9707-
and returns the list ( x | L in S and x in L ).</p>
9708-
</div>
9709-
<p>Card is a function that returns the cardinality of a sequence or a list of elements (which may be solution mappings or other types of elements, depending on the context).
9710-
<div class="defn">
9711-
<p><b>Definition: <span id="defn_Card">Card</span></b></p>
9712-
<p>Given a sequence or a list |L|, Card(|L|) is the cardinality of |L|.</p>
9713-
</div>
97149700
<section id="setFunctions">
97159701
<h5>Set Functions</h5>
97169702
<p>The set functions which underlie SPARQL aggregates all have a common signature:
@@ -9731,6 +9717,33 @@ <h5>Set Functions</h5>
97319717
this requires the parser to know whether some IRI refers to a function, cast, or
97329718
aggregate before it can determine if there are any errors in a query where aggregates
97339719
are used.</p>
9720+
<p>The definitions of the set functions in the following sections
9721+
are based on two functions, <a href="#defn_Flatten">Flatten</a>
9722+
and <a href="#defn_Card">Card</a>, which are defined as follows.</p>
9723+
<p><a href="#defn_Flatten">Flatten</a> is a function which is
9724+
used to collapse a sequence of lists into a single list.
9725+
For example, [(1,&nbsp;2), (3,&nbsp;4)] becomes (1,&nbsp;2,&nbsp;3,&nbsp;4).</p>
9726+
<div class="defn">
9727+
<p><b>Definition: <span id="defn_Flatten">Flatten</span></b></p>
9728+
<p>Let <var>S</var> be a sequence of lists,
9729+
i.e., <var>S</var> =
9730+
[<var>L<sub>1</sub></var>,
9731+
<var>L<sub>2</sub></var>, ...,
9732+
<var>L<sub><var>m</var></sub></var>]
9733+
where, for every <var>i</var> &in; {1, ..., <var>m</var>},
9734+
<var>L<sub><var>i</var></sub></var> is a list.</p>
9735+
<p>Flatten(<var>S</var>) is the list
9736+
( <var>x</var> | <var>L</var> in <var>S</var> and
9737+
<var>x</var> in <var>L</var> ).</p>
9738+
</div>
9739+
<p><a href="#defn_Card">Card</a> is a function that returns the
9740+
cardinality of a sequence or a list of elements (which may be
9741+
solution mappings or other types of elements, depending on the
9742+
context).
9743+
<div class="defn">
9744+
<p><b>Definition: <span id="defn_Card">Card</span></b></p>
9745+
<p>Given a sequence or a list |L|, Card(|L|) is the cardinality of |L|.</p>
9746+
</div>
97349747
</section>
97359748

97369749
<section id="aggCount">

0 commit comments

Comments
 (0)