W3C home > Mailing lists > Public > www-rdf-interest@w3.org > April 2001

Re: Reification of Sets (of RDF Statement, for Queries)

From: <jos.deroo.jd@belgium.agfa.com>
Date: Tue, 10 Apr 2001 12:50:27 +0100
To: sandro@w3.org
Cc: www-rdf-interest@w3.org
Message-Id: <OFC12D67CD.595E4BA6-ON41256A2A.00362124@bayer-ag.com>


> Issue 1: RDF M&S Does Not Provide Sets

Just to make sure that we talk about the same thing, I understand a set
as defined in http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=set
And yes, sets are needed the allow us to talk about "elements and relations"

> [...]
>
> Issue 2: Completeness of Knowledge  ("Closed" collections)
>
> [...]
>
>    4) LISP-style lists: predicates First and Rest, object TheEmptyList.
>
>        - a little complicated
>
>    5) ...?  anything else?

Well, we have been using recursive lists with predicate :list and object :nil
as you can find out at http://www.agfa.com/w3c/euler/lists.axiom.n3


> It's tempting to think in terms of the syntax where it looks like the
> list is complete:
>
> <list id=foo>
>   <li>a
>   <li>b
> </list>
>
> but in the abstract systax (think of the graph) that closing
> information is lost as the RDF parsers seem to handle it.  (As is the
> ordering, if you don't turn the "li" predicate into "_1"...)
>
> For making Sets from Lists:
>
>    1)  an Emumeration predicate, relating a set to a list which
>        contains all the same elements at least once
>
>    2)  an ElementSet predicate, the inverse of Enumeration
>
>    3)  ...?  anything else?
>
> To bring this together in an example, I'm trying to represent RDF
> queries in RDF (ie to reify them).  I think the right approach looks
> in n3 like:
>    :myQuery q:statements { ... bunch of statements ... };
>             q:variables ( ... list of terms in the statements
>                          which are variables ...).
> but the conversion of the "bunch of statements" and "list of terms"
> into proper RDF Sentences is subject to a resolution to the issues
> raised here.  My current vote is for (4) lisp-lists and (1) a set
> enumeration predicate.   If anyone has any objection to these, I'd be
> interested in hearing it.

One can also deal with lists via such predicates as :in (membership)
:append (concatenation) etc.
Something else is difference lists as defined at
http://www.cs.ncl.ac.uk/modules/1998-99/csc324/prolog/doc/userman/node6.html
  [[[A difference list is a special kind of a list. Instead of being ended
     by nil, a difference list has an uninstantiated tail so that new
     elements can be appended to it in constant time. A difference list
     is written as List - Tail where List is the beginning of the list
     and Tail is its uninstantiated tail. Programs that use difference
     lists are usually more efficient and always much less readable than
     programs without them.]]]
They are indeed very handy but one needs a notation to make a distinction
between (:a :b :c :d) where :d is a variable-list-element and
(:a :b :c ??? :d) where :d is a variable-list-tail.

>    -- sandro

--
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
Received on Tuesday, 10 April 2001 06:50:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:48 GMT