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 @@

2 Making Simple Queries (Informative)

-

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.

+

2.1 Writing a Simple Query

The example below shows a SPARQL query to find the title of a book from the @@ -752,7 +749,12 @@

2.4 Blank Node Labels in Query Results

-

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.

4.1 RDF Term Syntax

4.1.1 Syntax for IRIs

-

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.

Grammar rules:
@@ -1128,6 +1127,7 @@
  • """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
  • @@ -1271,6 +1271,14 @@
    + +

    + 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). +

    +

    4.1.3 Syntax for Query Variables

    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 @@

    4.2 Syntax for Triple Patterns

    -

    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
    +

    5.1 Basic Graph Patterns

    Basic graph patterns are sets of triple patterns. SPARQL graph pattern @@ -2743,11 +2762,20 @@

  • Blank nodes
  • IRIs
  • RDF literals
  • -
  • A plain literal is lower than an RDF literal with type 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 @@ _:zBlank nodes follow unbound. _:aThere is no relative ordering of blank nodes. <http://script.example/Latin>IRIs follow blank nodes. - <http://script.example/Кириллица>The character in the 23rd position, "К", has a unicode codepoint 0x41A, which is higher than 0x4C ("L"). - <http://script.example/日本語>The character in the 23rd position, "日", has a unicode codepoint 0x65E5, which is higher than 0x41A ("К"). + <http://script.example/Кириллица>The character in the 23rd position, "К", has a unicode codepoint 0x41A, which is higher than 0x4C ("L"). + <http://script.example/漢字> The character in the 23rd position, "漢", has a unicode codepoint 0x6F22, which is higher than 0x41A ("К"). "http://script.example/Latin"Simple literals follow IRIs. "http://script.example/Latin"^^xsd:stringxsd:strings follow simple literals. @@ -3359,7 +3387,8 @@ is determined by the SPARQL query processor. The query pattern is used to create a result set. The 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:

    - -
    - Definition: Evaluation of Filter(P, F) +L : a solution sequence +
    + Definition: Evaluation of Filter(F, + P)
    -eval(D(G), Filter(P, F)) = Filter(eval(D(G), F))
    +eval(D(G), Filter(F, P)) = Filter(F, eval(D(G),P))
    - Definition: Evaluation of Join(P1, P2, F) + Definition: Evaluation of + Join(P1, P2)
     eval(D(G), Join(P1, P2)) = Join(eval(D(G), P1), eval(D(G), P2))
    @@ -5704,7 +5736,12 @@
    Definition: Evaluation of a Graph Pattern
    -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