Re: update on vCard edits and The Compromise

(sorry, accidentally sent an incomplete reply, not to the semweb list,
though)

On 26.07.2007 09:39:28, Harry Halpin wrote:
>Bruce D'Arcus wrote:
>> Everyone I have talked to has discouraged use of rdf:Seq. 
Yes, I think that's a reasonable general suggestion, which should cover
both collections and containers (i.e. if you can model your domain
w/o explicit ordering, great.). But when it comes to seq vs. list,
I found seq to be more efficient.

>>AFAIK, you
>> cannot really query it (rdf:Seq) reliably with SPARQL either, though 
>>am not sure of that.
>Is that true? Oh dear. Anyone have more info?
You should be able to do (pseudo-sparql):

[[
   SELECT ?pos ?name WHERE {
       <#card4711> vcard:additional-names [ ?pos ?name ] .
   }
   ORDER BY ?pos .
]]

or (expanded):

[[
   SELECT ?pos ?name WHERE {
       <#card4711> vcard:additional-names ?seq .
       ?seq       ?pos ?name .
   }
   ORDER BY ?pos .
]]

Something like this at least lets you retrieve the names in one 
query, most stores should even get the sorting right (at least 
for i<10). SPARQLing rdf:List/rest/nil is more complicated or 
not possible at all if you don't know the list length.

(The query above will include the rdf:type=rdf:Seq triple, but
you could get rid of the non-rdf:li information via a FILTER 
or simple custom code.)


best,
benjamin

--
Benjamin Nowack
http://bnode.org/

Received on Thursday, 26 July 2007 15:07:06 UTC