Fwd: Working with lists

Note: forwarded message attached.


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

Forwarded message 1

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 UTC