- 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>
> 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 UTC