W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > February 2002

RE: Outstanding Issues - rdfms-seq-representation

From: Jeremy Carroll <jjc@hplb.hpl.hp.com>
Date: Wed, 20 Feb 2002 11:32:14 -0000
To: "Brian McBride" <bwm@hplb.hpl.hp.com>, "RDF Core" <w3c-rdfcore-wg@w3.org>
Message-ID: <JAEBJCLMIFLKLOJGMELDMEAPCDAA.jjc@hplb.hpl.hp.com>

> rdfms-seq-representation:

>  The ordinal property representation of containers does not
> support recursive processing of containers in languages such as Prolog.

> Hmmm.  Anyone got a proposal for fixing this?

YAWN, hire a Prolog programmar.

e.g.
suppose we have a predicate
triple(Subject,Property,Object).
defining our RDF database

implement a predicate

rdf_n(Property,N)

that succeeds whenever N is a positive integer and Property is "rdf:_" N
appropriately expressed.

Then a bag for example would be:


rdfBag(URI,Contents) :-
   bagof( Object,
              [N,Property]^ ( triple(URI,Property,Object),
                              rdf_n(Property,N) ),
          Contents ).



For a sequence

rdfSeq(URI,Contents) :-
   bagof( N*Object,
              [Property]^ ( triple(URI,Property,Object),
                              rdf_n(Property,N) ),
          UnsortedContents ),
   sort(UnsortedContents, SortedContents ),
% line below will work but is not efficient.
   bagof( Object, [N]^member(N*Object,SortedContents),
     Contents ).

If you can't hack this then program in VB.


Jeremy
Received on Wednesday, 20 February 2002 06:32:30 EST

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 09:45:17 EDT