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:
> Aha - the light it shines brightly in my eyes!
> 
> Thanks R_O_O_K, I did actually see your post but I have only now 
> understood it's consequences.
> 
> Though why doesn't it inherit that property when declaring an 
> "instanceOf". I was under the impression that that was the whole point 
> of the RDF type inheritance.
> 

It's a bug. We just switch to container-foo for typed nodes.
http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-list-elements 
says (at least that's the way I read it) that that is optional.

Actually, I read the spec to say that rdf:li should be parsed into 
rdf:_n in any situation, but that it makes most sense to do so in the 
rdf containers 
(http://www.w3.org/TR/rdf-syntax-grammar/#section-List-Expand).

I wonder if anybody cares to read the spec closely and confirm that 
thinking.

> Thanks for this, I guess I'll stick with the standard containers rather 
> than defining my own then.
> 
> Cheers,
> 
> Neil
> 
> 
> 
> R_O_O_K wrote:
> 
>> Hi!
>>
>> The trick is that writing
>> <rdf:Seq ...>
>> implicitly adds a rdf:nextVal predicate and thus
>> it is equal to sth like this
>>
>> <rdf:Description rdf:nextVal="1">
>>   <rdf:instanceOf 
>> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq">
>> </rdf:Description>
>>
>> Without this "nextVal" the template builder simply doesn't build the 
>> tree. I posted a comment on this at
>> http://www.xulplanet.com/tutorials/mozsdk/rdfsyntax.php
>> some time ago. Maybe it's high time it got into the RDF tutorial,
>> it seems to confuse many people.
>>
>> (Anyone on the XULPlanet team reading this post?)
>>
>> Best regards!
>> Michal Ziemski
>>
>> Dnia 2005-01-10 21:16, Użytkownik Neil Stansbury napisał:
>>
>>> Hi Axel,
>>>
>>> Thanks for this,
>>>
>>>> You can use containment or whatever the attribute is actually called 
>>>> on the template to add arcs to iterate over. What you do is hardly 
>>>> going to do alot useful, though.
>>>
>>>
>>>
>>>
>>> No but it will allow me to test whether a resource has the property 
>>> of 'my:Container' rather than just the generic 'rdf:Seq'. It just 
>>> seemed to make more sense semantically.
>>>
>>>> You could use plain containers, and use a instanceOf in the enum to 
>>>> add a new class. Or you go without it completely. Mixing rdf:li with 
>>>> other parents is likely to achieve brokeness.
>>>
>>>
>>>
>>>
>>> If I use the following RDF the tree doesn't build:
>>>
>>> <my:Container rdf:about="level1" my:name="Parent">
>>>   <rdf:instanceOf
>>>       rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/>
>>>   <rdf:li rdf:resource="level2"/>
>>> </my:Container>
>>>
>>> <my:Container rdf:about="level2" my:name="Child">
>>>   <rdf:instanceOf
>>>       rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/>
>>>   <rdf:li rdf:resource="level3"/>
>>> </my:Container>
>>>
>>> If I swap the 'my:Container' class for 'rdf:Seq' it builds fine.
>>>
>>> I take it this is what you mean by:
>>>
>>>  > Mixing rdf:li with other parents is likely to achieve brokeness.
>>>
>>> So in theory at least, how does the tree consider an assertion a 
>>> container?
>>>
>>>> There is no such thing as a non-standard rdf container.
>>>
>>>
>>>
>>>
>>> As in rdf:Seq, rdf:Bag, rdf:Alt
>>>
>>>
>>> Cheers,
>>>
>>>
>>>
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.