- From: Seaborne, Andy <andy.seaborne@hp.com>
- Date: Fri, 10 Jun 2005 13:22:12 +0100
- To: kendall@monkeyfist.com, DAWG Mailing List <public-rdf-dawg@w3.org>
To end section 2. cc: www-archive removed. This list is archived. Comments accepted unless noted below: See CVS log for things accepted that aren't purely editorial. Andy Kendall Clark wrote: > Andy & Eric, > > I'm attaching my review of 1.377 of rq23. It's an annotated copy of the spec > itself. That seemed a bit easier for me and, hopefully, for you guys to > process. I'm hoping that the W3 list archiver turns HTML attachments into > links. > > Anyway, I'm happy to discuss any of the comments in the review. FYI, I > stopped the review around section 11.1. I made nearly 300 <strike> or <ins> > annotations, and then I got really tired of doing that. :> > > All in all, good show on the spec! > > Kendall Clark > > ... > > This document describes the query language part of [Where's the > "S"?] Done Protocol And RDF Query Language (SPARQL) [I think the acronym for > the query language and protocol shouldn't be overloaded in this document > to refer to the query language alone. It's potentially confusing and bad > marketing to boot.] for easy access to RDF stores. It is designed to > meet the requirements and design objectives described in RDF Data Access > Use Cases and Requirements <http://www.w3.org/TR/rdf-dawg-uc/> There isn't a separe name for the query language. It already says "query language part of". > > 1 Introduction > > An RDF graph is a set of triples, e. Each triple consistings of a > /subject/, a /predicate/ and an /object/, as defined in RDF Concepts and > Abstract sSyntax <http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/>. Done by making the abstract syntax clause a sentence. > These triples can come from a variety of sources. For instance, they may > come directly from an RDF document. They may be inferred from other RDF > triples. They may be the RDF expression of data stored in other formats, > such as XML or relational databases. > > SPARQL is a query language for getting information from such RDF graphs. > It provides facilities to: > > * extract information in the form of URIs, blank nodes, plain and > typed literals. > * extract RDF subgraphs. > * construct new RDF graphs based on information in the queried graphs. > * Why not say something here about ASK too? I regard that covered by point one : I can't think of suitable other wording. (Point 2 is specifically picking out a charter requirement.) > > As a data access language, it is suitable for both local and remote use. > When used across networks, the companion SPARQL Protocol for RDF > <http://www.w3.org/TR/rdf-sparql-protocol/> document [11 <#ref11>] > describes a remote access protocol.The companion SPARQL Protocol for RDF > <http://www.w3.org/TR/rdf-sparql-protocol/> document [11 <#ref11>] > describes a remote access protocol suitable for use across networks. """ As a data access language, it is suitable for both local and remote use. The companion SPARQL Protocol for RDF document [11] describes the remote access protocol. """ > > 2 Making Simple Queries > . . . > > Later sections of this document describe how other graph patterns can be > built using the graph operators |OPTIONAL <#optionals>| and |UNION > <#alternatives>|,; how they may be grouped <#GroupPatterns> together; > and also how queries can extract information from more than one graph > <#queryDataset>; and how It is also possible to restrict the values > allowed in matching a pattern. Kept the last part as-is because it emphaises the combination of triples patterns. > > Variables in SPARQL queries have global scope; [This is really awkward: > it is the same variable everywhere in the query that the name is used. > How about something like this instead: "Each syntactically identical > occurrence of the same variable string is semantically the same > variable" That's no good, but something in that direction is more clear > that the present text. IMO.] Changed "the same name is used" Don't know what "semantic" was intended to convey here. Variables are indicated by '?'; the '?' > does not form part of the variable. '$' is an alternative to '?' to help > where systems use '?' as a substitution character. In a query, |$abc| > and |?abc| are the same variable. > . . . > > Triple Patterns <#defn_TriplePattern> are written as a list of subject, > predicate, object; -there are abbreviated ways <#syntaxMisc> of writing > some common triple pattern constructs. Left in. > 2.2 Initial Definitions > > *Definition:* RDF Term > > let I be the set of all IRIs. > let RDF-L be the set of all RDF Literals > <http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-literal> > let RDF-B be the set of all blank nodes > <http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node> > > The set of RDF Terms, RDF-T, is I union RDF-L union RDF-B. > > This definition of RDF Term collects together several basic notions from > the RDF data model > <http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-data-model>.[This > adds nothing to the spec, IMO.] Left in - emphasising that this defn wouldn't be a defn if RDF had defined this. > 2.4 Matching of Basic Graph Patterns > > *Definition:* Pattern Solution > > A pattern solution is a function from a subset of the set of variables > to the set of RDF terms, RDF-T. > > The result of replacing every v in a graph pattern P by S(v) is written > S(P). > > "Pattern Solution" is abbreviated to "Solution" where it is clear to do > so. [Are "query result" and "solution" also synonyms? They are used > interchangeable herein. Further, this comment really only confuses me. > Now every time I see "solution", I wonder if you mean "pattern solution" > or are you speaking generically? Shurely it's not worth saving 7 > characters a few times?] Not really. I've removed the formal definition of "results" (it was no longer used elsewhere) and so "results" is a more informal term. Solution is only a pattern solution, possibly {Side effect: the definitions donot have a notion of completeness so allowing inference graphs to be better handled). > 2.7 Blank Nodes > > > Blank Nodes and Queries > > A blank node <http://www.w3.org/TR/rdf-concepts/#section-blank-nodes> > can appear in a query pattern. It behaves as a variable, although it can > not cannot left "can not" > be mentioned in the query result form or anyplace else in any > part of the query other than outside a graph pattern. Removed the "outside graph pattern" - left over from pre-modifiers days. > > Blank nodes in queries are distinct from all blank nodes in the data. A > blank node in a graph pattern does not match a blank node in the data by > blank node label. > > > Blank Nodes and Query Results > > In the results of queries, tThe presence of blank nodes can be indicated > in query results by labels in the serializations of those results. An > application or client receiving the results of a queryA consumer of > query results Kept as is : To me, "consumer" is no better than "client" or "application" (we don't talk about "producers"). > > 2.8 Other Syntactic Forms > > The SPARQL uses a "Turtle-like" syntax for writing syntax for > representing basic graph patterns, is Turtle plus with the addition of > named variables. Dropped first sentenance. > Blank Nodes > > Blank nodes have labels which are scoped to the query. They are written > as "|_:a|" for a blank node with label "|a|". > > A blank node that is used in only one place in the query syntax [Does > this mean used in only one place in the string that represents a > particular query?] can be abbreviated with "[]". A unique blank node > will be created and used to form the triple pattern. Yes - example "[] :p :q ; :x : y ." > > The "[:p :v]" construct can be used to form a triple patterns with a > blank node for its subject. Or more than one triple as per later example - left as is. > > The following two forms: > > [ :p "v" ] . > > [] :p "v" . > > allocate a unique blank node label (here "|b57|") and are equivalent to > writing: > > _:b57 :p "v" . > > Abbreviated blank node syntax can be combined with other abbreviations > for common predicates and common objects. > > [ foaf:name ?name ; > foaf:mbox <alice@example.org> ] > > This is the same as writing the following basic graph pattern for some > uniquely allocated blank node: > > _:b18 foaf:name ?name . > _:b18 foaf:mbox <alice@example.org> . > > > RDF Collections > > RDF collections can be written in triple patterns using the syntax "( > )". The form "()" is short for an abbreviatio of resource |rdf:nil| or > <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> > <http://www.w3.org/TR/rdf-schema/#ch_nil>. > > (1 ?x 3) > > is short for: > > _:b0 rdf:first 1 . > _:b0 rdf:rest _:b1 . > _:b1 rdf:first ?x . > _:b1 rdf:rest _:b2 . > _:b2 rdf:first 3 . > _:b2 rdf:rest rdf:nil . > > > Other > > The keyword "|a|" can be used as a predicate in a triple pattern and is > short foran abbreviation of |rdf:type|. > > ?x a :Class1 . > [ a :myClass ] :p "v" . > > ?x rdf:type :Class1 . > _:b0 rdf:type :myClass . > _:b0 :p "v" . > >
Received on Friday, 10 June 2005 12:22:26 UTC