Uniqueness of blank node labels

All,

I'd like to throw out a minor thing, I don't know what's been said about it 
before: http://www.w3.org/TR/sparql11-query/#bgpBNodeLabels
says that:
"When using blank nodes of the form _:abc,  labels for blank nodes are scoped 
to the basic graph pattern.  A label can be used in only a single basic graph 
pattern in any query."

From a query writer's perspective, it is good that blank nodes are scoped to a 
BGP whereas variables are globally scoped. However, it would be nice if the 
blank node label didn't need to be used just a single time in a query, for 
practically the same reasons that lexical scoping is good for programming.

For instance, if two different programmers write code that produce BGPs for 
different parts of a query, and they work independently, currently, if they 
use the same label in different BGPs, there would be breakage. As such, using 
a variable or a blank node for variables you don't need projected are pretty 
much the same thing: If you recycle a variable you get unexpected results, if 
you recycle a blank node label you would get an error, as I understand it.

From a query writer's perspective, it would be nice if they were different -- 
it would be nice if you could just mindlessly use a blank node label again 
and again, you just need to make sure that they are unique in the scope of 
the BGP. I think this would ease writing very complex queries, in particular 
queries where different modules are involved.

Of course, this puts an extra burden on the query engine, so it may not be 
worth it, but I'd like to bring it up.


Cheers,

Kjetil
-- 
Kjetil Kjernsmo
PhD Research Fellow, University of Oslo, Norway
Semantic Web / SPARQL Query Federation
kjekje@ifi.uio.no              http://www.kjetil.kjernsmo.net/

Received on Wednesday, 19 January 2011 22:31:26 UTC