Re: RDF Containers in XUL Trees

Axel Hecht <[email protected]>
Newsgroups gmane.comp.mozilla.devel.rdf
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Neil Stansbury wrote:
> http://www.w3.org/TR/rdf-schema/#ch_containervocab
> 
> Particularly:
> 
> <snip>
> Container membership properties may be applied to resources other than 
> containers.
> </snip>
> 
> Thus <rdf:li> should be a valid property in any resource.
> 
> I assume that the 'nextVal' property is conceptually similar to the 
> 'rdf:first' and 'rdf:rest' property: 
> http://www.w3.org/TR/rdf-schema/#ch_collectionvocab
> 
> Though reading the schema, it says the 'Container' class is open and can 
> have more members:
> 
> <snip>
> The RDF Collection vocabulary of classes and properties can describe a 
> closed collection, ie. one that can have no more members
> </snip>
> 
> So it sounds like Mozilla treats an <rdf:Seq> with it's need for a 
> 'nextVal' property like a Collection class with it's 'rdf:first' property.
> 

Don't make guesses on RDF. From nsRDFContainer.cpp:

/*

   Implementation for the RDF container.

   Notes
   -----

   1. RDF containers are one-indexed. This means that a lot of the loops
      that you'd normally think you'd write like this:

        for (i = 0; i < count; ++i) {}

      You've gotta write like this:

        for (i = 1; i <= count; ++i) {}

      "Sure, right, yeah, of course.", you say. Well maybe I'm just
      thick, but it's easy to slip up.

   2. The RDF:nextVal property on the container is an
      implementation-level hack that is used to quickly compute the
      next value for appending to the container. It will no doubt
      become royally screwed up in the case of aggregation.

   3. The RDF:nextVal property is also used to retrieve the count of
      elements in the container.

  */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.