W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2005

Re: Minor Syntax issues

From: Alberto Reggiori <alberto@asemantics.com>
Date: Tue, 15 Feb 2005 18:51:12 +0100
Message-Id: <b7ed76f23cd445cc2b1136f530de6083@asemantics.com>
Cc: "'RDF Data Access Working Group'" <public-rdf-dawg@w3.org>
To: andy.seaborne@hp.com


On Feb 15, 2005, at 6:02 PM, Seaborne, Andy wrote:

> Thanks for the note - for now I have made some changes for publication.

cheers!

for the BASE keyword in the prolog (me also guessing your 
interpretation of it and thinking of xml:base) we could update section 
"2.1 Writing a Simple Query", the "Query Term Syntax" paragraph adding 
something like:

[[

By using the BASE keyword at the beginning of the prolog of the query 
is possible to explicitly specify a base URI for the purpose of 
resolving relative URIs such as the ones used in the PREFIX 
declarations, in specifying RDF Datasets or any other relative URI 
reference inside the graph-patterns.

]]

( for the interpretation of the BASE attribute we could perhaps grab 
some text from the XML-Base spec http://www.w3.org/TR/xmlbase/#escaping 
)

some possible examples of queries using BASE in the prolog:

example1:

BASE <http://example.org/>
PREFIX  dc: <http://purl.org/dc/elements/1.1/>
PREFIX  : <book/> # here the base should apply
SELECT  ?title
WHERE   ( :book1  dc:title  ?title )

example2:

BASE <urn:x-local:>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?name ?mbox ?date
WITH   <details>  # here the base should apply
FROM   <graph1>  <graph2>
WHERE
     ( ?g dc:publisher ?name)
     ( ?g dc:date ?date )
     GRAPH ?g
     {
       ( ?person foaf:name ?name )
       ( ?person foaf:mbox ?mbox )
     }

example3:

BASE <http://example.org/book/>
SELECT ?title
WHERE  ( <book1> <http://purl.org/dc/elements/1.1/title> ?title ) #the 
base should apply to the subject URI ref here


Yours

Alberto

>
> For this week's publication the state is:
>
> 1/ BOUND(?x) - no change
>
> 2/ Left as AND for now.
>
> 3/ Just OPTIONAL, not []
>
> (note that OPTIONAL can take a {} pattern or a plain triple pattern - 
> restricting to just {} would be OK).
>
> 4/ No change to functions/casting/builtins although this does look 
> like it can be simplified - it just requires more time than is 
> available before publication.
>
> 5/ WITH done.
>
> 6/ Clause order unchanged
>
> 	Andy
>
>
> Alberto Reggiori wrote:
>> Andy,
>> for the record, here are our answers/input to your syntax issues
>> On Feb 11, 2005, at 10:02 PM, Seaborne, Andy wrote:
>>> This is about tuning the current syntax, post-WD2 publication, not 
>>> redesigning the whole thing.
>>>
>>> 1/ Bound
>>>
>>> This is special because it tests the variable, not the value.  It's 
>>> the only
>>> case where this happens.
>>>
>>> The suggestion (PatH) was to make this different.  In other 
>>> programming languages, there is just a plain function like many 
>>> other library functions.  It returns a value (a boolean) like any 
>>> other function.
>>>
>>> Options:
>>> 1a/ BOUND(?x)   -- as the current grammar
>> +1 for current form in the grammar
>>> 1b/ BOUND[?x]   --  different grouping
>>>
>>> Anything with a colon in it will look like a qname.
>>>
>>> BOUND ?x is dangerous as it does not express the tight binding 
>>> nature of
>>> this operator: "BOUND ?x && ?y" is strange.
>>>
>>> I prefer "BOUND(?x)" -- leave as is.
>>> BOUND[] as a one-off is over doing it.
>>>
>>> 2/ AND
>>>
>>> AND is a special keyword that starts constraints (SUCH THAT would be 
>>> better
>>> but its two words).  Currently in the grammar it is required because 
>>> ?x-?y is unclear : can be "?x binary minus ?y" or two expressions 
>>> "?x" then "unary minus ?y"
>> please keep AND for this round still
>>> Proposal: use [] to mark constraints (see below).
>>>
>>> 3/ OPTIONALS
>>>
>>> There are two syntactic forms "OPTIONAL" and "[]"
>>>
>>> Proposal: just the OPTIONAL form, freeing up [] for constraints.
>> ok to drop [] and use only OPTIONAL keyword
>>> 4/ Functions , casting and specials.
>>>    &ex:foo() , xsd:byte(23) , isBlank(?x)
>> we are neutral about this one
>>> 5/ LOAD => WITH
>>>
>>> The word "LOAD" suggests, to some people, a permanent change to the 
>>> database which is a wrong implication.  DaveB suggested changing the 
>>> word to "WITH".  I have done this change (rq23 and the tests).
>> ok for WITH change
>>> 6/ Clause order
>>>
>>> The current order is:
>>>
>>> BASE
>>> PREFIX
>>> SELECT
>>> WITH
>>> FROM
>>> WHERE
>>> LIMIT
>>>
>>> which is a mixed style.  It would make sense to have WITH and FROM 
>>> before SELECT (declarations first) and have LIMIT before WHERE 
>>> (modifier to SELECT).  It has confused some RDQL users that FROM 
>>> comes after SELECT.
>> ok for given order - but please add few lines explaining BASE keyword 
>> in the prolog, still only mentioned into grammar/bnf in ver. 1.207
>> Yours
>> Alberto
>> -
>> Alberto Reggiori, @Semantics S.R.L.
>> www.asemantics.com
>>
-
Alberto Reggiori, @Semantics S.R.L.
www.asemantics.com
Received on Tuesday, 15 February 2005 17:51:16 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:22 GMT