Re: scope of alias variables

On 13 Nov 2009, at 15:10, Andy Seaborne wrote:
> That leaves it whatever is right to do about
>
>    SELECT (?x AS ?A)
>    { <x> :p ?A }

Typo for { ?x :p ?A }?

If so then it's one of those things that in spec terms there's  
probably little cost, but depending on how people's implementations  
work it might end up being a pain. In 4store for example I join an  
extra column for the new expression, then project, so it would be  
tricky for me to handle:
   (?x, ?A) -> (?x, ?A, ?A) -> project (?A)
Not impossible though.

But that example also raises the question about whether it should be  
legal to project variables that haven't been bound. My recollection is  
that SPARQL 1.0 is not very clear about whether it's allowed or not.  
The terminology (bound v's unbound) implies that it might be OK, but  
that's pretty user-unfriendly in my experience - typos like Andy's  
(possible example) are a bit too easy to do.

We issue a warning in 4store, FWIW. Not sure if I'd be in favour of it  
being an error or not.

- Steve

-- 
Steve Harris, CTO, Garlik Limited
2 Sheen Road, Richmond, TW9 1AE, UK
+44(0)20 8973 2465  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10  
9AD

Received on Saturday, 14 November 2009 06:02:56 UTC