diff --git a/spec/index.html b/spec/index.html index 3eabcac0..02de2ab4 100644 --- a/spec/index.html +++ b/spec/index.html @@ -3674,7 +3674,7 @@
The "<" operator (see the Operator
Mapping and 17.3.1 Operator Extensibility) defines
the relative order of pairs of numerics
,
- xsd:strings
, xsd:booleans
and xsd:dateTimes
. Pairs of
+ xsd:strings
, xsd:booleans
, xsd:dateTimes
, and Triple Terms. Pairs of
IRIs are ordered by comparing them as literals with datatype xsd:string
.
SPARQL also fixes an order between some kinds of RDF terms that would not otherwise be ordered:
@@ -3683,6 +3683,7 @@SPARQL does not define a total ordering of all possible RDF terms. Here are a few examples of pairs of terms for which the relative order is undefined:
@@ -5418,9 +5419,7 @@@@ -5476,11 +5509,6 @@
- Operators = and != applied to - triple terms - apply the operator to each of the components. -
SPARQL language extensions may provide additional associations between operators and @@ -6084,6 +6112,68 @@
+ xsd:integer compareTripleTerm (Triple term term1, Triple term term2) ++ +
This function cannot be used directly in expressions. The purpose + of this function is to define the semantics of comparison operators, + such as "=" and "<", + for the case of comparing Triple Terms. + The function is used in Section . +
+ +This function returns -1, 0, 1, or throws an error. + Comparison is performed pairwise on the components of the triple terms in the order subject, predicate, object until the result is determined. + An error is thrown if comparing two components results in an error.
+ +The result of this function is determined by going through the following steps.
+ +SUBJECT(term1) = SUBJECT(term2)
evaluates to true, go to step 2.
+ If SUBJECT(term1) < SUBJECT(term2)
evaluates to true, return -1.
+ If SUBJECT(term1) > SUBJECT(term2)
evaluates to true, return 1.
+ If any of the evaluations causes an error, raise an error.
+ PREDICATE(term1) = PREDICATE(term2)
evaluates to true, go to step 3.
+ If PREDICATE(term1) < PREDICATE(term2)
evaluates to true, return -1.
+ If PREDICATE(term1) > PREDICATE(term2)
evaluates to true, return 1.
+ If any of the evaluations causes an error, raise an error.
+ OBJECT(term1) = OBJECT(term2)
evaluates to true, return 0.
+ If OBJECT(term1) < OBJECT(term2)
evaluates to true, return -1.
+ If OBJECT(term1) > OBJECT(term2)
evaluates to true, return 1.
+ If any of the evaluations causes an error, raise an error.
+ Examples:
+compareTripleTerm | +Results | +
---|---|
compareTripleTerm(<<(:s :p :o)>>, <<(:s :p :o)>>) |
+ 0 | +
compareTripleTerm(<<(:s :p 123)>>, <<(:s :p 124)>>) |
+ -1 | +
compareTripleTerm(<<(:s :p 123)>>, <<(:s :p 122)>>) |
+ 1 | +