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

Fwd: Working with lists

From: naudts guido <naudts_vannoten@yahoo.com>
Date: Mon, 15 Mar 2004 03:22:24 -0800 (PST)
Message-ID: <20040315112224.35374.qmail@web40513.mail.yahoo.com>
To: public-cwm-talk@w3.org

Note: forwarded message attached.


__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

attached mail follows:



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
Received on Monday, 15 March 2004 06:22:55 GMT

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