diff -au rq25{-1.101,}.html --- rq25-1.101.html 2007-09-14 16:28:36.000000000 -0400 +++ rq25.html 2007-09-14 16:25:41.000000000 -0400 @@ -557,11 +557,8 @@
The SPARQL query language is based on matching graph patterns. Graph -patterns contain triple patterns. Triple patterns are like RDF triples, but with the option -of a query variables in place of RDF terms in the subject, -predicate or object positions. Combining triple patterns gives a basic graph pattern, -where an exact match to a graph is needed.
+Most forms of SPARQL query contain a set of triple patterns called a basic graph pattern. Triple patterns are like RDF triples except that each of the subject, predicate and object may be a variable. A basic graph pattern matches a subgraph of the RDF data when RDF terms from that subgraph may be substituted for the variables and the result is RDF graph equivalent to the subgraph.
+The example below shows a SPARQL query to find the title of a book from the @@ -752,7 +749,12 @@
Query results can contain labeled blank nodes.
++ Query results can contain blank nodes. Blank nodes in the example + result sets in this document are written in the form + "_:" followed by a blank node label. +
+Blank node labels are scoped to a result set (as defined in "SPARQL
Query Results XML Format") or, for the CONSTRUCT
query
form, the result graph.
@@ -986,12 +988,9 @@
is given in appendix A.
The terms delimited by "<>
" are IRI references [RFC3987];
-the delimiters do not form part of the reference. IRI references stand for IRIs, either directly
-or relative to a base IRI. IRIs are a generalization of URIs [RFC3986]
-and are fully compatible with URIs and URLs.
The SPARQL syntax provides two abbreviation mechanisms for IRIs: prefixed names -and relative IRIs.
+ +The IRIref production designates the set of IRIs [RFC3987]; IRIs are a generalization of URIs [RFC3986] and are fully compatible with URIs and URLs. The PrefixedName production designates a prefixed name. The mapping from a prefixed name to an IRI is described below. IRI references (relative or absolute IRIs) are designated by the IRI_REF production, where the '<' and '>' delimiters do not form part of the IRI reference. Relative IRIs match the irelative-ref reference in section 2.2 ABNF for IRI References and IRIs in [RFC3987] and are resolved to IRIs as described below.
+@@Check this against the final grammar.
"""The librarian said, "Perhaps you would enjoy 'War and Peace'.""""
1
, which is the same as "1"^^xsd:integer
1.3
, which is the same as "1.3"^^xsd:decimal
1.300
, which is the same as "1.300"^^xsd:decimal
1.0e6
, which is the same as "1.0e6"^^xsd:double
true
, which is the same as "true"^^xsd:boolean
false
, which is the same as "false"^^xsd:boolean
+ Tokens matching the productions INTEGER, DECIMAL, DOUBLE and
+ BooleanLiteral are equivalent to a typed
+ literal with the lexical value of the token and the corresponding
+ datatype (xsd:integer
, xsd:decimal
, xsd:double
, xsd:boolean
).
+
Query variables in SPARQL queries have global scope; use of a given variable name anywhere in a query identifies the same variable. Variables are prefixed by @@ -1397,8 +1405,8 @@
Triple Patterns are written as a list of subject, -predicate, object; there are abbreviated ways of writing some common triple pattern +
Triple Patterns are written as a whitespace-separated list of a subject, +predicate and object; there are abbreviated ways of writing some common triple pattern constructs.
The following examples express the same query:
@@ -1588,6 +1596,17 @@ conjunction: basic graph patterns, which combine triples patterns, and group graph patterns, which combine all other graph patterns. +The outer-most graph pattern in a query is called the query pattern. It is grammatically identified by
+ +GroupGraphPattern
in
[13] |
+ WhereClause |
+ ::= | +'WHERE'? GroupGraphPattern |
+
Basic graph patterns are sets of triple patterns. SPARQL graph pattern @@ -2743,11 +2762,20 @@
xsd:string
- of the same lexical form.A plain literal is lower than an RDF literal with type xsd:string
of the same lexical form.
The relative order of literals with language tags or typed literals with different types is undefined.
+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:
+ +This list of variable bindings is in ascending order:
@@ -2761,8 +2789,8 @@_:z
_:a
<http://script.example/Latin>
<http://script.example/Кириллица>
<http://script.example/日本語>
<http://script.example/Кириллица>
<http://script.example/漢字>
"http://script.example/Latin"
"http://script.example/Latin"^^xsd:string
DESCRIBE
form takes each of the resources identified
in a solution, together with any resources directly named by IRI, and assembles
-a single RDF graph by taking a "description" from the target RDF Dataset. The
+a single RDF graph by taking a "description" which can come from any
+information available including the target RDF Dataset. The
description is determined by the query service. The syntax DESCRIBE *
is an abbreviation that describes all of the variables in a query.
@@ -3641,6 +3670,7 @@
The XQuery Effective Boolean Value rules rely on the definition of XPath's fn:boolean. The following rules reflect the rules for fn:boolean
applied to the argument types present in SPARQL Queries:
xsd:boolean
, xsd:string
or numeric is false if the lexical form is not valid for that datatype (e.g. "abc"^^xsd:integer).xsd:boolean
, the EBV is the value of that argument.xsd:string
, the EBV is false if the operand value has zero length; otherwise the EBV is true.Write μ0 for the mapping such that dom(μ0) is the empty set.
+Write μ for solution mappings and
+Write μ0 for the mapping such that dom(μ0) is the empty set.
Write Ω0 for the multiset consisting of exactly the empty mapping μ0, with cardinality 1.
@@ -5409,8 +5440,8 @@If μ1 and μ2 are compatible then μ1 set-union μ2 is also a mapping. Write merge(μ1, μ2) for μ1 set-union μ2
-Write card[Ω](μ) for the cardinality of μ in a multiset of mappings Ω. - If μ is not a member of Ω, cardinality is not defined.
+Write card[Ω](μ) for the cardinality of solution mapping μ in a multiset + of mappings Ω.
Let BGP be a basic graph pattern and let G be an RDF graph.
μ is a solution for BGP from G when there is a pattern instance - mapping P such that P(BGP) is a subgraph of G and μ is a restriction of P to + mapping P such that P(BGP) is a subgraph of G and μ is the restriction of P to the query variables in BGP.
card[Ω](μ) = card[Ω](number of distinct RDF instance mappings, σ, such that P = μ(σ) is a pattern instance mapping and P(BGP) is a subgraph of G).
@@ -5540,7 +5571,8 @@Definition: LeftJoin
-Let Ω1 and Ω2 be multisets of solution mappings and F a filter. We define:
+Let Ω1 and Ω2 be multisets of solution mappings and + expr be an expression. We define:
LeftJoin(Ω1, Ω2, expr) = Filter(expr, Join(Ω1, Ω2)) set-union Diff(Ω1, Ω2, expr)
@@ -5666,17 +5698,17 @@ D[i] : The graph with IRI i in dataset D D[DFT] : the default graph of D P, P1, P2 : graph patterns -L : a solution sequence - - --eval(D(G), Filter(P, F)) = Filter(eval(D(G), F))+eval(D(G), Filter(F, P)) = Filter(F, eval(D(G),P))
eval(D(G), Join(P1, P2)) = Join(eval(D(G), P1), eval(D(G), P2))
-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+
eval(D(G), Graph(var,P)) = Let R be the empty multiset foreach IRI i in D