W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2017

Re: Should support querying RDF lists

From: Holger Knublauch <holger@topquadrant.com>
Date: Thu, 13 Jul 2017 09:04:57 +1000
To: public-sparql-dev@w3.org
Message-ID: <51d9d784-2368-6994-1a2f-a0e0c1b4689b@topquadrant.com>
This reminds me of an item I would like to see in a possible SPARQL 1.2: 
official support for property functions, aka magic properties. 
Currently, SPARQL functions can only return a single node. In many 
practical use cases, functions need to iterate over rows with 
potentially multiple values. Some SPARQL processors introduce their 
custom hacks to achieve that, e.g. list structures on the left and right 
hand side of a "magic" predicate. SPARQL 1.2 might introduce a more 
explicit mechanism for such things, e.g. with a variation of BIND called 
FOREACH, and start it off with a built-in property function such as

     ?list a rdf:List .
     FOREACH (listMembers(?list) AS (?member, ?index)) .
     # This would loop over all members, binding ?member and ?index

More important than having a particular listMember function would be the 
general extensible mechanism though.

Just a thought, not worked out in detail.


On 12/07/2017 21:08, Pavel Klinov wrote:
> On Wed, Jul 12, 2017 at 2:08 AM, Victor Porton <porton@narod.ru 
> <mailto:porton@narod.ru>> wrote:
>     Why does SPARQL 1.1 not contain requesting an ordered RDF list
>     (rdf:first/rdf:rest/rdf:nil)?!
>     It is a highly useful feature. I am to using it in my software.
> Well, no disrespect, but this isn't quite a strong evidence of utility...
>     There is ORDER BY, but it seems it cannot be used for this kind of
>     query.
> You can implement most basic operations, e.g. accessing the n-th 
> element or all elements, using property paths. It may not be 
> completely trivial but it's not rocket science either. [1] is a good 
> reference.
> Best,
> Pavel
> [1] http://www.snee.com/bobdc.blog/2014/04/rdf-lists-and-sparql.html
>     Let's discuss how to make such an extension to SPARQL.
Received on Wednesday, 12 July 2017 23:05:31 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 12 July 2017 23:05:31 UTC