Re: (Postponed) issue: accessingCollections

Danny Ayers wrote:
> Good morning,
> 
> A post over on redland-dev [1] brought my attention to the current
> postponed status of the question of accessing Collections/containers
> (even though there appears to be some coverage for Collections in the
> draft..?). As and when the issue returns from postponement, I'd like
> the following to be taken into consideration.
 >
 > It's the containers side this post concerns.

rdfs:member [1] provides a way to access containers:

WHERE { ?x rdf:type rdf:Bag . ?x rdfs:member ?y }

One of the reasons for postponing is that it that it isn't completely clear it 
requires query language support.  Inference may solve the problem.

A similar approach may work with ":listMember" property [2]

[1] http://www.w3.org/TR/rdf-schema/#ch_member
[2] http://lists.w3.org/Archives/Public/public-rdf-dawg/2005JanMar/0079.html

> I can totally understand
> avoiding putting anything in place to cover the user-expected
> semantics of containers, as opposed to what RDF Semantics covers. So
> preservation of the order of an rdf:Seq probably doesn't have a place
> in the spec. But to retain some utility, the current behaviour of
> Redland seems to work.
> 
> Example - an RSS feed contains:
> 
> <channel rdf:about="http://www.xml.com/xml/news.rss">
>     <title>XML.com</title>
>     <items>
>       <rdf:Seq>
>         <rdf:li resource="http://xml.com/pub/2000/08/09/xslt/xslt.html" />
>        ...  
>     ...
>   ...
> <item rdf:about="http://xml.com/pub/2000/08/09/xslt/xslt.html">
>     <title>Processing Inclusions with XSLT</title>
>  ...
> 
> Given a query:
> 
> SELECT ?name, ?title, ?x, ?y  WHERE
> { 
>  ?channel rdf:type rss:channel .
>  ?channel rss:title ?name .
>  ?channel rss:items ?x .
>  ?x ?y ?item .
>  ?item rdf:type rss:item .
>  ?item rss:title ?title .
> }
>  
> This will return:  
> ?name =  "XML.com"
> ? title = "Processing Inclusions with XSLT"
> 
> ?x is bound a bnode, y is bound to a resource of the form rdf:_9. 
> 
> This kind of access provides the necessary connectivity, and I'd
> suggest would do for at least a provisional approach for the spec,
> with the proviso that the actual binding of ?y remains unspecified.
> 
> I don't know if there a precedent for deprecation by proxy, but it
> wouldn't seem unreasonable to me to include a note saying "RDF
> implementors intending to use SPARQL should avoid using containers in
> their designs".
> 
> Cheers,
> Danny.
> 
> [1] http://lists.gnomehack.com/pipermail/redland-dev/2005-June/000961.html

The example query there is old SPARQL syntax - at the time there was no ORDER 
BY.  The real issue there is that results are not ordered.  They can be now:

SELECT ?name ?title
WHERE
   {
     ?channel rdf:type rss:channel ;
              rss:title ?name ;
              rss:items ?x .
     ?x rdf:type rdf:Seq ;
        ?y ?item .
     ?item rdf:type rss:item ;
           rss:title ?title .
   }
ORDER BY ?y

which removes the other triples properties (here, like the
?x rdf:type rdf:Seq) because of the item match.

	Andy

Received on Tuesday, 7 June 2005 17:43:12 UTC