- From: Birte Glimm <birte.glimm@comlab.ox.ac.uk>
- Date: Tue, 26 Oct 2010 17:55:21 +0100
- To: SPARQL Working Group <public-rdf-dawg@w3.org>
Hi all, as I got an action (ACTION-329) today to come up with a definition for what SELECT * actually means (possibly by rephrasing the potentially bound text). Here's mmy attempt. Ideally, I would just want to say: If Q is a query with * in the select clause (SELECT *), then * is an abbreviation for all variables that are in scope for Q. This requires, however, that variable scope of a query is properly defined and in the current Query 1.1 spec we just have: 4.1.3 Syntax for Query Variables @@SPARQL 1.1 : need to modify the variable scope description to reflect subqueries. Thus, here's my attempt of defining scope, so that I can use the definition for SELCT * as above: Let Q be a query with group graph pattern G. The variables in scope for Q, written scope(Q) are the variables in scope of G, written scope(G). The variables in scope of a group graph pattern are recursively defined as follows: A group graph pattern G can either be a sub-select query (SubSelect from the grammar) or a sub-group graph pattern (GroupGraphPatternSub from the grammar). If G is a sub-group graph pattern, then G can contain blocks of triples in addition to a non-triple graph pattern (GraphPatternNotTriples in the grammar). Variables occurring in the blocks of triples are in scope of G. If G contains a non-triple graph pattern composed of one or more group graph patterns G1 to Gn, e.g., OPTIONAL G1 or G1 UNION G2, then variables in scope(Gi) for each 1 <= i <= n are in scope for G. If G is a sub-select query with group graph pattern G', then scope(G) = scope(G'). Any comments are welcome as usual. Bire -- Dr. Birte Glimm, Room 309 Computing Laboratory Parks Road Oxford OX1 3QD United Kingdom +44 (0)1865 283520
Received on Tuesday, 26 October 2010 16:55:54 UTC