Re: SPARQL prefixes and local parts

Hello Mark and Jiri,

Thank you for your comments. 

The DAWG has decided in the past on this issue to stay close to the XML 
definition of QName syntax for SPARQL. In particular, a decisions was made 
in
  http://www.w3.org/2005/06/28-dawg-minutes
for SPARQL QName local names to conform to XML syntax on this issue.

I wanted to point out a few options:
  1) You can refer to absolute URIs in queries (i.e. you needn't always 
use prefixed names in your queries, you can directly refer to <
http://example.org/schemas/Concept1> within a SPARQL query.
  2) In many cases, you can achieve the abbreviations you are looking for 
by defining a base URI using the SPARQL BASE keyword and then by using 
relative URIs within the query. For example:

BASE <http://example.org/schemas/>
SELECT * WHERE {
  ?s <Concept1/SubconceptA> ?o .
}

I hope that this addresses your concerns. At this point in time, I do not 
see new information here for the Working Group to revisit this issue.

thanks,
Lee

Jiri Dokulil wrote on 01/08/2007 01:17:10 PM:

> 
> For the same reason, I think # should be allowed as well.
> I've already used a two-level structure that shared a common
> namespace, but the two levels were separated by #.
> For instance:
> http://example.org/foo/bar/class1#attribute1
> http://example.org/foo/bar/class1#attribute2
> http://example.org/foo/bar/class2#attribute2
> http://example.org/foo/bar/class2#attribute3
> 
> But in the current SPARQL grammar, it is necessary to define different
> namespace prefixes for each "class" instead of using simple
> ns:class2#attribute2
> 
> Note: This class-attribute structure may be a bad way to create an
> ontology, but the source of the data forced it to be this way.
> 
> Jiri Dokulil
> 
> On 1/8/07, mark.d.wood@kodak.com <mark.d.wood@kodak.com> wrote:
> >
> > The current SPARQL specification states the following for prefixed 
names:
> >
> > The PREFIX keyword associates a prefix label with an IRI. A prefixed 
name is
> > a prefix label and a local part, separated by a colon ":". It is 
mapped to
> > an IRI by concatenating the local part to the IRI corresponding to the
> > prefix. The prefix label may be the empty string.
> >
> > The grammar for local parts does not allow slashes in the name.
> >
> > I would like to suggest that local parts should in fact allow for 
slashes in
> > the local part of the name.   This allows one to define prefixes that 
are
> > basically the root of some structure.
> >
> > For example, one might wish to define a prefix
> >
> > PREFIX ex1:  <http://www.example.org/schemas/Concept1>
> > PREFIX ex2:  <http://www.example.org/schemas/Concept1>
> >
> > and therefore specify abbreviated IRIs such as:
> >
> > ex1:SubConceptA/SubConcept1
> >
> > and
> >
> > ex2:SubConceptB/SubConcept2
> >
> > Without this ability, one must either define a very flat namespace, or
> > define separate prefixes for every concept.
> >
> > -Mark Wood
> >
> 

Received on Tuesday, 23 January 2007 20:59:30 UTC