Re: sparlx.rnc in CVS

Kendall Clark wrote:
> On Thu, Mar 24, 2005 at 12:25:14PM +0000, Seaborne, Andy wrote:
> 
> 
>>sparqlx.rnc defines something rather different - it does not seem to allow 
>>the nesting of GRAPH and UNION for example.  Is there a reason for
>>this?
> 
> 
> My struggle to understand the grammar of sparql -- the only reason I
> can think of.
> 
> 
>>I 
>>would assume it isn't a restriction due to the protocol
> 
> 
> Absolutely not. I would have made that very clear if that were the
> case.
> 
> 
>>element query-pattern {
>>      (element group-pattern
>>         | element triple-pattern
>>         | element optional-group { group-pattern }
>>         | element dataset-constraint {
>>             (uri | variable), group-pattern
>>           }
>>         | element union { group-pattern* }
>>         | element constraint { ... }
>>         | element group-pattern
>>      )*
>>    }
> 
> 
> Ah, okay, I understand this better now. 
> 
> 
>>[[Apologies for any incomprehensible RelaxNG - I haven't quite got round to 
>>setting up some tools for it yet.]]
> 
> 
> Mine isn't great either, but I think
> 
>      http://www.w3.org/2001/sw/DataAccess/sparqlx.rnc
>      # $Id: sparqlx.rnc,v 1.3 2005/03/24 14:20:03 kclark Exp $
> 
> does what you're asking for (in a different way, but same thing, I
> believe).

Not really.  I am suggesting that any XML syntax follow the abstraction of a 
query in rq23 so that mapping between different syntaxes is as straight forward 
as possible.  A common abstract form provides the simplest way I know of doing that.

An XML form is not for human consumption so it has the opportunity to be regular 
and straight forward.  By modelling a query different from the way it is defined 
in rq23 created unnecessary differences.  For example, the schema you give 
requires transformation before it could be used with the text syntax but there 
is no need for it to do that.

There still multiple ways of encoding the same query; that makes it harder for 
tools which was the argument for an XML form.

	Andy

> The relevant section now reads:
> 
> group-pattern =
>     element group-pattern {
>         attribute optional { xsd:boolean }?,
>         (group-pattern*, triple-pattern*, dataset-constraint*, union*, constraint?)
>     }
> 
> I still have optional as an attribute; though I believe that to be
> semantically equivalent to the optional-group element form you
> suggested.
> 
> Kendall Clark
> 

Received on Thursday, 24 March 2005 14:58:30 UTC