- From: Peter Waher <Peter.Waher@clayster.com>
- Date: Sun, 3 Jun 2012 18:02:23 +0000
- To: Andy Seaborne <andy.seaborne@epimorphics.com>, "public-rdf-dawg-comments@w3.org" <public-rdf-dawg-comments@w3.org>
Hello Andy.
Thanks for the response. And while the "AS Var"-part is unnecessary in a DESCRIBE query, the expression part might be in handy to create simpler queries.
Example:
DESCRIBE COALESCE(?iri1, ?iri2)
WHERE
{
...
}
instead of having to write:
DESCRIBE ?iri3
WHERE
{
...
BIND(COALESCE(?iri1,?iri2) AS ?iri3)
}
The first would be more in line with the syntax of similar SELECT queries.
Just a thought... Now I understand how you were thinking. While I was thinking about the expression part as the main function, the specification focuses on the name binding.
Sincerely,
Peter Waher
-----Original Message-----
From: Andy Seaborne [mailto:andy.seaborne@epimorphics.com]
Sent: den 3 juni 2012 19:44
To: public-rdf-dawg-comments@w3.org
Subject: Re: Bindings in the DESCRIBE clause
On 03/06/12 17:50, Peter Waher wrote:
> Hello Andy
>
> Thanks for the quick response.
>
> I'll take your word for it. Looking at the document you linked to, I cannot see that the grammar has been updated to include variable bindings in the DESCRIBE clause [11], as is allowed in [9] for SELECT:
> http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#sparqlGrammar
>
> Sincerely,
> Peter Waher
I understood your reference to "bindings" to be the keyword in the SPARQL language as theer had been a grammar problem with the query forms.
Expressions are not allowed in DESCRIBE. They weren't in SPARQL 1.0
because only terms from the target graph can be returned from a query.
In SPARQL 1.1 with assignment (select expressions, or BIND), it is
possible to calculate new terms but it is always to a named variable.
The AS keyword is needed.
SELECT expressions are a shorthand for a BIND assignment, and give a
name to the result variable. It is shorthand as the algebra translation
puts in the same algebra operator.
DESCRIBE, and CONSTRUCT, can include BIND, or a subquery. This can
include COALESCE. The shorthand syntax of SELECT sits a little at odds
with DESCRIBE and CONSTRUCT as they do not have output variables.
Andy
> -----Original Message-----
> From: Andy Seaborne [mailto:andy.seaborne@epimorphics.com]
> Sent: den 3 juni 2012 17:32
> To: public-rdf-dawg-comments@w3.org
> Subject: Re: Bindings in the DESCRIBE clause
>
> Hi Peter,
>
> This has been fixed
>
> http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#sparqlGrammar
>
>
> By the way: BINDINGS is set to change to generalise it -- some discussion:
>
> http://lists.w3.org/Archives/Public/public-sparql-dev/2012AprJun/0018.html
>
> Andy
>
> On 03/06/12 13:00, Peter Waher wrote:
>> Hello
>>
>> Any reason why bindings in the DESCRIBE clause using expressions is
>> not permitted in SPARQL 1.1, when they are permitted in the SELECT clause?
>>
>> Compare [11] and [9] in:
>>
>> http://www.w3.org/TR/sparql11-query/#sparqlGrammar
>>
>> Example: Describe the first iri that is well defined, using the
>> COALESCE function.
>>
>> This could be done using BIND [62], but a SPARQL user would expect
>> syntax to be consistent.
>>
>> Sincerely,
>>
>> Peter Waher
>>
>
>
Received on Sunday, 3 June 2012 18:03:09 UTC