W3C home > Mailing lists > Public > public-semweb-lifesci@w3.org > June 2007

Re: Using Labels in SPARQL

From: Dan Brickley <danbri@danbri.org>
Date: Fri, 01 Jun 2007 12:36:22 +0100
Message-ID: <466004B6.3080801@danbri.org>
To: Bijan Parsia <bparsia@cs.man.ac.uk>
CC: public-semweb-lifesci hcls <public-semweb-lifesci@w3.org>

Bijan Parsia wrote:
> Looking at some of the queries in:
>     http://esw.w3.org/topic/HCLS/Banff2007Demo?action=AttachFile&do=get&target=Banff2007Part2.pdf 
> I am reminded again of the practice of using gensyms for the URIs of 
> terms, e.g.,:
>     ?class rdfs:subClassOf go:GO_0008150
> In Swoop, we added the ability for the display (e.g., class tree, 
> definitions) to replace URIs with the label of your (language) choice. 
> I'm sure other tools do that as well. Obviously, a query creation tool 
> could do this as well.
> I was wondering if it would be worth adding some syntactic sugar to 
> sparql to support this style. 

Perhaps I misunderstand the issue, but I wonder whether a block of 
additional PREFIX declarations would be enough in some cases.

Eg. testing in http://xmlarmyknife.org/api/rdf/sparql/query (ARQ-based),
I can write the usual:

	PREFIX foaf: <http://xmlns.com/foaf/0.1/>
	SELECT * WHERE {?x a foaf:Document }
...or I can use PREFIX to create direct abbreviations for classes and 
properties, in this case abbreviating the verbose and forgettable word 
"Document" to the more user-friendly "Doc":

	PREFIX foaf: <http://xmlns.com/foaf/0.1/>
	PREFIX Doc: <http://xmlns.com/foaf/0.1/Document>
	SELECT * WHERE {?x a Doc: }

This would only be useful where a limited number of such declarations 
were needed. And they'd still clutter the query, but would at least be 
isolated to a set of skimmable declarations at the top of the query, 
rather than in the intellectually more demanding WHERE clause.


Received on Friday, 1 June 2007 11:56:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:20:27 UTC