- From: Dan Connolly <connolly@w3.org>
- Date: 20 Feb 2002 08:21:57 -0600
- To: Jeremy Carroll <jjc@hplb.hpl.hp.com>
- Cc: Brian McBride <bwm@hplb.hpl.hp.com>, RDF Core <w3c-rdfcore-wg@w3.org>
On Wed, 2002-02-20 at 05:32, Jeremy Carroll wrote: > > > 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. I raised this issue, and I didn't say anything about prolog when I raised it. I can't read prolog well enough to tell if the code below works; if it works, it relies on prolog's closed-world reasoning, which I find unacceptable. The issue is: how do I conclude that something is *not* in a sequence? e.g. how do I write an empty sequence? what does it look like in n-triples? I could write <rdf:Seq/> but that will end up in n-triples as _:something rdf:type rdf:Seq. but it won't say that _:something has no members. Without the ability to tell where the end of a sequence is, they're of little use in the applications I build. I tend to use DAML+OIL's first/rest, including a special parseType="ont:collection". > 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 ). what does that code do when there are rdf_n doesn't succeed at all? Does it conclude by NAF that Contents is empty? > 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 > -- Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Wednesday, 20 February 2002 09:22:23 UTC