diff --git a/spec/index.html b/spec/index.html index 70bf09c..2369ddd 100644 --- a/spec/index.html +++ b/spec/index.html @@ -8374,10 +8374,10 @@

Solution Sequence Modifiers

A solution sequence modifier is one of:

-

GroupConcat(S, scalarvals) = +

GroupConcat(S, scalarvals) = GCList(L, sep),

where L = Flatten(S) and GCList(L, sep) @@ -10257,169 +10262,167 @@

GroupConcat
L, and L2..n is L without its first element.

-

For example, GroupConcat([("a"), ("b"), ("c")], {"separator" → "."}) +

For example, GroupConcat([("a"), ("b"), ("c")], {"separator" → "."}) = GCList( ("a", "b", "c"), "." ) = "a.b.c".

Sample
-

Sample is a set function which returns an arbitrary value from the sequence passed +

Sample is a set function which returns an arbitrary value from the sequence passed to it.

Definition: Sample

-
RDFTerm Sample(sequence S)
+
RDFTerm Sample(sequence S)

If Card(S) = 0, then - Sample(S) = error.

+ Sample(S) = error.

If Card(S) > 0, then - Sample(S) = v, where v + Sample(S) = v, where v in Flatten(S).

-

For example, given Sample([("a"), ("b"), ("c")]), "a", "b", and "c" are all valid return - values. Note that the Sample function is not required to be deterministic for a given input. The +

For example, given Sample([("a"), ("b"), ("c")]), "a", "b", and "c" are all valid return + values. Note that the Sample function is not required to be deterministic for a given input. The only restriction is that the output value must be present in the input sequence.

Evaluation Semantics

-

We define eval(D(G), algebra expression) as the evaluation of an algebra expression with - respect to a dataset D having active graph G. The active graph is initially the default - graph.

-
-D : a dataset
-D(G) : D a dataset with active graph G (the one patterns match against)
-D[i] : The graph with IRI i in dataset D
-P, P1, P2 : graph patterns
-L : a solution sequence
-F : an expression
-          
+

We define eval(|D|(|G|), |A|) as the evaluation of an algebra expression |A| with + respect to a dataset |D| having active graph |G|. The active graph is initially the default + graph of |D|. Further symbols and notation used in the following definitions are:

+

Definition: Evaluation of a Basic Graph Pattern

-
eval(D(G), BGP) = multiset of solution mappings
+

eval( |D|(|G|), |BGP| ) = multiset of solution mappings

See section Basic Graph Patterns

Definition: Evaluation of a Property Path Pattern

-
eval(D(G), Path(X, path, Y)) = multiset of solution mappings
-

See section Property Path Expresions

+

eval( |D|(|G|), Path(|X|, |path|, |Y|) ) = multiset of solution mappings

+

See section Property Path Expressions

Definition: Evaluation of Filter

-
eval(D(G), Filter(F, P)) = Filter(F, eval(D(G),P), D(G))
+

eval( |D|(|G|), Filter(|F|, |P|) ) = Filter( |F|, eval(|D|(|G|), |P|), |D|(|G|) )

'substitute' is a filter function in support of the evaluation of EXISTS and NOT EXISTS forms which were translated to exists.

Definition: Substitute

-

Let μ be a solution mapping.

+

Let μ be a solution mapping.

-

substitute(pattern, μ) = the pattern formed by replacing every occurrence of - a variable v in pattern by μ(v) for each v in dom(μ)

+

substitute(|pattern|, μ) = the pattern formed by replacing every occurrence of + a variable |v| in |pattern| by μ(|v|) for each |v| in dom(μ)

Definition: Evaluation of Exists

-

Let μ be the current solution mapping for a filter and P a graph pattern:

+

Let μ be the current solution mapping for a filter and |P| a graph pattern:

- The value exists(P), given D(G) is true if and only if eval(D(G), substitute(P, μ)) is + The value exists(|P|), given |D|(|G|) is true if and only if eval( |D|(|G|), substitute(|P|, μ)) is a non-empty sequence.

Definition: Evaluation of Join

-
eval(D(G), Join(P1, P2)) = Join(eval(D(G), P1), eval(D(G), P2))
+

eval( |D|(|G|), Join(P1, P2) ) = Join( eval(|D|(|G|), P1), eval(|D|(|G|), P2) )

Definition: Evaluation of LeftJoin

-
-eval(D(G), LeftJoin(P1, P2, F)) = LeftJoin(eval(D(G), P1), eval(D(G), P2), F)
-            
+

+eval( |D|(|G|), LeftJoin(P1, P2, |F|) ) = LeftJoin( eval(|D|(|G|), P1), eval(|D|(|G|), P2), |F| ) +

Definition: Evaluation of Union

-
eval(D(G), Union(P1,P2)) = Union(eval(D(G), P1), eval(D(G), P2))
+

eval( |D|(|G|), Union(P1, P2) ) = Union( eval(|D|(|G|), P1), eval(|D|(|G|), P2) )

Definition: Evaluation of Graph

-if IRI is a graph name in D
-    eval(D(G), Graph(IRI,P)) = eval(D(D[IRI]), P)
+if IRI is a graph name in D
+    eval( D(G), Graph(IRI,P) ) = eval( D(D[IRI]), P )
             
-              if IRI is not a graph name in D
-                  eval(D(G), Graph(IRI,P)) = the empty multiset
+              if IRI is not a graph name in D
+                  eval( D(G), Graph(IRI,P) ) = the empty multiset
             
-eval(D(G), Graph(var,P)) =
-    Let R be the empty multiset
-    foreach IRI i in D
-        R := Union(R, Join( eval(D(D[i]), P) , Ω(?var->i) ) )
-    the result is R
+eval( D(G), Graph(var,P) ) =
+    Let R be the empty multiset
+    foreach IRI i in D
+        R := Union(R, Join( eval(D(D[i]), P) , Ω(var->i) ) )
+    the result is R
             
-

The evaluation of graph uses the SPARQL algebra union operator. The multiplicity of a - solution mapping is the sum of the multiplicities of that solution mapping in each join +

The evaluation of graph uses the Union operator. The multiplicity of a + solution mapping is the sum of the multiplicities of that solution mapping in each Join operation.

Definition: Evaluation of Group
-

eval(D(G), Group(exprlist, P)) = Group(exprlist, eval(D(G), P))

+

eval( |D|(|G|), Group(|exprlist|, |P|) ) = Group( |exprlist|, eval(|D|(|G|), |P|) )

Definition: Evaluation of Aggregation
-

eval(D(G), Aggregation(exprlist, func, scalarvals, Grp)) = Aggregation(exprlist, func, - scalarvals, eval(D(G), Grp))

+

eval( |D|(|G|), Aggregation(|exprlist|, |func|, |scalarvals|, |Grp|) ) = Aggregation( |exprlist|, |func|, + |scalarvals|, eval(|D|(|G|), |Grp|) )

Definition: Evaluation of AggregateJoin
-

eval(D(G), AggregateJoin(A1, ..., An)) = - AggregateJoin(eval(D(G), A1), ..., eval(D(G), An))

+

eval( |D|(|G|), AggregateJoin(A1, ..., An) ) = + AggregateJoin( eval(|D|(|G|), A1), ..., eval(|D|(|G|), An) )

-

Note that if eval(D(G), Ai) is an error, it is ignored.

+

Note that if eval(|D|(|G|), Ai) is an error, it is ignored.

Definition: Evaluation of Extend

-
-eval(D(G), Extend(P, var, expr)) = Extend(eval(D(G), P), var, expr)
-            
+

+eval( |D|(|G|), Extend(|P|, |var|, |expr|) ) = Extend( eval(|D|(|G|), |P|), |var|, |expr| ) +

Definition: Evaluation of ToList

-
eval(D(G), ToList(P)) = ToList(eval(D(G), P))
+

eval( |D|(|G|), ToList(|P|) ) = ToList( eval(|D|(|G|), |P|) )

Definition: Evaluation of Distinct

-
eval(D(G), Distinct(L)) = Distinct(eval(D(G), L))
-            
+

eval( |D|(|G|), Distinct(|L|) ) = Distinct( eval(|D|(|G|), |L|) ) +

Definition: Evaluation of Reduced

-
eval(D(G), Reduced(L)) = Reduced(eval(D(G), L))
-            
+

eval( |D|(|G|), Reduced(|L|) ) = Reduced( eval(|D|(|G|), |L|) ) +

Definition: Evaluation of Project

-
eval(D(G), Project(L, vars)) = Project(eval(D(G), L), vars)
-            
+

eval( |D|(|G|), Project(|L|, |vars|) ) = Project( eval(|D|(|G|), |L|), |vars| ) +

Definition: Evaluation of OrderBy

-
eval(D(G), OrderBy(L, condition)) = OrderBy(eval(D(G), L), condition)
-            
+

eval( |D|(|G|), OrderBy(|L|, |condition|) ) = OrderBy( eval(|D|(|G|), |L|), |condition| ) +

Definition: Evaluation of ToMultiSet

-
eval(D(G), ToMultiSet(L)) = ToMultiSet(eval(D(G), L))
+

eval( |D|(|G|), ToMultiSet(|L|) ) = ToMultiSet( eval(|D|(|G|), |L|) )

Definition: Evaluation of Slice

-
-eval(D(G), Slice(L, start, length)) = Slice(eval(D(G), L), start, length)
-            
+

+eval( |D|(|G|), Slice(|L|, |start|, |length|) ) = Slice( eval(|D|(|G|), |L|), |start|, |length| ) +