W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > April to June 2009

Re: Requesting input for the Features and Rational document

From: Axel Polleres <axel.polleres@deri.org>
Date: Mon, 15 Jun 2009 22:56:16 +0100
Message-ID: <4A36C380.8030401@deri.org>
To: "Seaborne, Andy" <andy.seaborne@hp.com>
CC: Steve Harris <steve.harris@garlik.com>, Kjetil Kjernsmo <Kjetil.Kjernsmo@computas.com>, "public-rdf-dawg@w3.org" <public-rdf-dawg@w3.org>
Seaborne, Andy wrote:
> 
>> -----Original Message-----
>> From: public-rdf-dawg-request@w3.org [mailto:public-rdf-dawg-
>> request@w3.org] On Behalf Of Steve Harris
>> Sent: 15 June 2009 12:07
>> To: Kjetil Kjernsmo
>> Cc: public-rdf-dawg@w3.org
>> Subject: Re: Requesting input for the Features and Rational document
>>
>> On 10 Jun 2009, at 09:42, Kjetil Kjernsmo wrote:
>>
>>> On Thursday 04 June 2009 08:46:29 Lee Feigenbaum wrote:
>>>>> * ProjectExpression needs a better description and motivation.
>>>>> We feel that the mention of XSLT is not very relevant, as
>>>>> assigning a
>>>>> name automatically, like some engines do now, is sufficient for
>>>>> XSLT.
>>>>> It should also be motivated by showing why it is required by other
>>>>> features.
>>>> I took a stab at this at
>>>> http://www.w3.org/2009/sparql/wiki/Feature:ProjectExpressions
>>> As discussed on the teleconf yesterday, it needs better examples
>>> too. It
>>> doesn't sound like the examples are actually executeable as it is
>>> now, and
>>> they should be. Also, it is also a good thing if they do not rely on
>>> other
>>> features that we do not yet have, such as concat().
>>>
>>> It is good to have both SELECT and CONSTRUCT examples.
>>>
>>> Can anyone have a stab at this?
>>   CONSTRUCT { ?x foaf:name (concat(?fn, " ", ?sn)) . }
> 
> Can we adopt F&O naming here?  It's "fn:concat" 
> 
> Tricky - () looks awfully like a list to a parser.  Especially if the function is named by URI.

Indeed....


Option 1)
> Suggestion: off the top of my head: ?(expr)
> 
>    CONSTRUCT { ?x foaf:name $(fn:concat(?fn, " ", ?sn)) . }
> 
> Not necessary beautiful but it will work.

Option 2) another options here is to leave it without extra syntax, but 
add a TODO mentioning that

     fn:concat(?fn, " ", ?sn)

    is problematic for parsers due to the similarity with list notation.
    I.e.

TODO: Note that expressions such as fn:concat(?fn, " ", ?sn) are 
potentially problematic for parsers due to their similariy with the 
shortcut notation for 
[http://www.w3.org/TR/rdf-sparql-query/#collections RDF Collections]

Option 3) is actually the subselect, i.e. the complete corrected example:

  CONSTRUCT { ?x foaf:name ?concat . }
  WHERE {
    { SELECT ?x fn:concat(?fn, " ", ?sn) AS ?concat
      WHERE { ?x foaf:firstName ?fn ; foaf:family_name ?sn . }
    }
  }


Are Options 1) or 2) implemented anywhere?


Option 4)
If you look for something which is implemented, we have an
implementation for a slightly different version of Option 1) in XSPARQL [1]:

    CONSTRUCT { ?x foaf:name {fn:concat(?fn, " ", ?sn)} . }
    WHERE { ?x foaf:firstName ?fn ; foaf:family_name ?sn . }

  I had, BTW, Option 2 implemented in some preliminary,
experimental parser for dlvhex-sparql [2], but basically at the
cost of sacrificing the collection shortcut notation.

best,
Axel

1. http://xsparql.deri.org/
For the example see: 
http://xsparql.deri.org/spec/xsparql-language-specification.html#fig:rdf2rdf_xsparql
Implementation:
http://sourceforge.net/project/showfiles.php?group_id=243296


2. Axel Polleres, François Scharffe, and Roman Schindlauer. SPARQL++ for 
mapping between RDF vocabularies. In OTM 2007, Part I : Proceedings of 
the 6th International Conference on Ontologies, DataBases, and 
Applications of Semantics (ODBASE 2007), volume 4803 of Lecture Notes in 
Computer Science, pages 878-896, Vilamoura, Algarve, Portugal, November 
2007. Springer.

> This is a place where explicit assignment would be useful syntax.
> 
>>   WHERE { ?x foaf:firstName ?fn ; foaf:family_name ?sn . }
>>
>> As a projection it would be something like:
>>
>>   CONSTRUCT { ?x foaf:name ?concat . }
>>   WHERE {
>>     { SELECT ?x, concat(?fn, " ", ?sn) AS ?concat
> 
> SELECT ?x fn:concat....
> 
> (no comma - comma in SELECT lists are in the time permitting query language syntax.
> 
>>     WHERE { ?x foaf:firstName ?fn ; foaf:family_name ?sn . } }
>>   }
>>
>> - Steve
> 
> 	Andy
> 


-- 
Dr. Axel Polleres
Digital Enterprise Research Institute, National University of Ireland, 
Galway
email: axel.polleres@deri.org  url: http://www.polleres.net/
Received on Monday, 15 June 2009 21:56:56 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:39 GMT