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.

suppose we have a predicate
defining our RDF database

implement a predicate


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.

Received on Wednesday, 20 February 2002 06:32:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:24:10 UTC