Re: determining the cardinality of a container

Hi Chris,

My apologies for the delayed response.

If I understand correctly, you would like to be able to write code like:

   for int i=1, container.getProp(RDF.size).getInt() {
     ...
   }

The question here is what does the size property of the container 
represent.  An application may have a partial description of a container, 
so whilst the application knows about the first n elements say, there may 
be more.  Does the RDF.size property represent the number of elements in 
the container as a whole, or the the number the application knows about.

RDFCore are discussing the problem of 'closing' containers right now.  The 
idea of closure is that RDF gives you no way to determine whether you know 
all the members of container, or whether there might be more somewhere you 
don't know about.  One approach to this is to add a property that indicates 
the number of members in the container.  This is not the front running 
option right now, but even if it were, I don't think it would help you that 
much since it would indicate the number of members in the container, not 
the number that your application might know about right now.

I suggest what you are trying to do is a matter for an implementation to 
deal with.  An RDF api could choose to track the number of members it knows 
about.  In the Jena api we do something like:

   NodeIterator iter = container.iterator();
   while (iterator.hasNext()) {
     ...
   }

which is the typical naive loop in java.

Brian



At 06:32 03/04/2002 -0500, Chris Waterson wrote:
>[freed from spam trap -rrs]
>
>Date: Tue, 2 Apr 2002 18:50:52 -0500 (EST)
>Message-ID: <3CAA458B.4090406@netscape.com>
>From: waterson@netscape.com (Chris Waterson)
>MIME-Version: 1.0
>To: www-rdf-comments@w3.org
>
>Not sure if this has been discussed already, apologies in advance if it has.
>
>There ought to be a provision for determining the number of elements
>`contained in' an RDF container. This is useful, for example, when
>performing a naive iteration over the elements in the container.
>
>chris

Received on Friday, 26 April 2002 04:53:39 UTC