Re: Sparql grammar questions/comments

Geoff Chappell wrote:
> I've been building a simple parser/translator from sparql to RDF Gateway's
> query language (in our scripting language). It's been mostly straight
> forward except around expressions. Things seem a bit murky there in the
> grammar.

The published working draft does not cover constaints very much - tehgrammr is 
just one reflection of this.

> For example things like this are seemingly allowed:
> 
> 	... OPTIONAL AND ?a>2
> 
> or 
> 	
> 	... SOURCE ?src AND ?x=='huh?'
> 
> which I can't translate because I don't really know what they mean.
> 
> Also it seems that an expression could just be:
> 
> 	AND ?x
> 
> Is that intended to be a valid expression?

The examples you give will need soring out - the published grammar is a 
permissive one and is supposed to cover what's right without being very tight on 
what's wrong.

Also, expressions are not typed in the grammar, as is usual in programming 
languages, and there would need to be additional checking after syntactic parsing.

> 
> What about:
> 
> 	AND ?a eq ?b eq 'dog'
> 
> Would you interpret that as (?a eq ?b) eq 'dog'? or (?a eq ?b) && (?b eq
> 'dog')?

The grammar says (?a eq ?b) eq 'dog', not that it makes a lot of sense.

> 
> I guess I'm wondering if I should just hold off on playing with expressions
> for a bit (i.e. the grammar isn't really ready yet for close inspection).
> Or...?
> 
> Also, though I guess you haven't published it for comments yet, two thumbs
> up anyway for the initial protocol draft
> (http://monkeyfist.com/kendall/sparql-protocol/). I'm so happy to see that
> the protocol will include update capabilities - makes it hugely more useful.
> 
> 
> Thanks,
> 
> Geoff Chappell

Thanks for the comments,

	Andy

Received on Monday, 15 November 2004 11:46:13 UTC