W3C home > Mailing lists > Public > public-cwm-talk@w3.org > January to March 2004

list processing

From: naudts guido <naudts_vannoten@yahoo.com>
Date: Mon, 15 Mar 2004 05:26:48 -0800 (PST)
Message-ID: <20040315132648.81758.qmail@web40503.mail.yahoo.com>
To: public-cwm-talk@w3.org

Oeps, something went wrong, the text again:
Hallo,
Here is how I plan to implement lists in RDFEngine
(http://cvs.sourceforge.net/viewcvs.py/eulersharp/2004/02swap/RDFEngine):
For a triple like:
1) :a rdf:List (:c :d :e).
I create an object resource that contains a (Python)
list: [:c, :d, :e]. 
This I have implemented. What I did not implement is  
then statements like:
a rdf:type rdf:List.
what, as a query, must give a positive response given 
the triple 1.
Also :a rdf:first ?x. should give as response:
:a rdf:first :c.
Also :a rdf:rest ?r. should give as a response:
:a rdf:rest (:d :e). ??? I'm not sure about that. 
To be frankly I think the way lists are defined at the
moment is a bit problematic.  
Personally I would also like to see something like:
:x :indexOf :a; :value "2".
what should return the second element of the list :a.
Guido.

--- Graham Klyne <gk@ninebynine.org> wrote:
> 
> I notice (from the change log) that CWM's collection
> (list) handling has 
> changed, and that it seems to be difficult to
> perform some "simple" 
> inferences over lists.
> 
> Below is some test code that I assumed would do some
> simple inferences on 
> lists of values, but which doesn't do any of what
> I'd expect.
> 
> I wonder if I'm missing something here?  Am I the
> only person who's trying 
> to use RDF collections (lists) in this way?
> 
> #g
> --
> 
> [[
> # Cwm-list-test.n3
> #
> # Command line used:
> #   C:\Dev\W3C\Swap1144\cwm.py --n3=tl --think
> Cwm-list-test.n3
> 
> @prefix rdf: 
> <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix rdfs:
> <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix rdft:
> <http://id.ninebynine.org/2003/rdfext/rdft#> .
> @prefix wd:  
> <http://id.ninebynine.org/wip/2003/wlanDevices/> .
> @prefix wp:  
> <http://id.ninebynine.org/wip/2003/wlanPolicy/> .
> @prefix wc:  
> <http://id.ninebynine.org/wip/2003/wlanConnection/>
> .
> @prefix :     <#> .
> 
> wp:WlanPolicy a wp:ConnectionPolicy ;
>      wp:allowedConnections
>        ( [ wc:devid "1" ; wc:devid "9" ]
>          [ wc:devid "2" ; wc:devid "8" ]
>          [ wc:devid "2" ; wc:devid "9" ]
>        ) .
> 
> :foo :bar ( "1" "2" "3" ) .
> 
> 
> # Simple rule to annotate a list link element
> 
>    { ?r rdf:first ?h . }
> =>
>    { ?r a :List } .
> 
> 
> # Auxiliary rules to flatten members of a collection
> 
>    { ?r rdf:first ?h ;
>         rdf:rest  ?t . }
> =>
>    { ?r rdft:includes ?h ;
>         rdft:more     ?t . } .
> 
>    { ?r rdft:more ?m .
>      ?m rdf:first ?h ;
>         rdf:rest  ?t . }
> =>
>    { ?r rdft:includes ?h ;
>         rdft:more     ?t . } .
> ]]
> 
> 
> ------------
> Graham Klyne
> For email:
> http://www.ninebynine.org/#Contact
> 

 


__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
Received on Monday, 15 March 2004 08:27:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:11:01 GMT