Re: What does r:Bag mean?

[Jimmy Cerra]
> Tom,
>
> Thanks for the reply; I really appreciate it.
> ...
> So a possible XML serialization would be:
>
> <r:Description
>   r:about="theCommitte"
>   r:type="http://www.foo.com#Committee">
>   <ex:treasurer rdf:resource="http://www.bar.com#Jim" />
>   <ex:membership>
>     <r:Bag>
>       <r:li r:resource="http://www.bar.com#Jim" />
>       <r:li r:resource="http://www.bar.com#John" />
>       <r:li r:resource="http://www.bar.com#Jane" />
>       <r:li r:resource="http://www.bar.com#Jamie" />
>     </r:Bag>
>   </ex:membership>
> </r:Description>
>
> Correct?

That is what I had in mind, but I cannot vouch for the correctness of every
syntax detail.  I suggest trying them out on the W3C RDF validator.  It will
also give you a graph of the triple and you can check to see if different
version give you the same graphs.

> And the Bag represents an unordered set (in the mathematical
> sense) of resource?

No, not a set because there could be duplicates.  But unordered.

>What would be the difference between that and the
> following:
>
> <r:Description
>   r:about="theCommitte"
>   r:type="http://www.foo.com#Committee">
>   <ex:treasurer rdf:resource="http://www.bar.com#Jim" />
>   <ex:membership r:resource="http://www.bar.com#Jim" />
>   <ex:membership r:resource="http://www.bar.com#John" />
>   <ex:membership r:resource="http://www.bar.com#Jane" />
>   <ex:membership r:resource="http://www.bar.com#Jamie" />
> </r:Description>
>
> Does that mean the same thing?  How is the meaning different?

It depends on what you mean by "mean".  In the first, membership is a
collection.  In the second, membership is a single-valued property.  The
graph would be different.  That might or might not look different to a
processor depending on what it was programmed to understand.

The difference is like being handed a list on a single sheet of paper or
being handed a handful of business cards.  The same information may be there
but it is not exactly the same.

> And how
> is that different from:
>
> <r:Description
>   r:about="theCommitte"
>   r:type="http://www.foo.com#Committee">
>   <ex:treasurer rdf:resource="http://www.bar.com#Jim" />
>   <ex:membership r:parseType="Collection">
>       <r:type
>         r:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag" />
>       <r:li r:resource="http://www.bar.com#Jim" />
>       <r:li r:resource="http://www.bar.com#John" />
>       <r:li r:resource="http://www.bar.com#Jane" />
>       <r:li r:resource="http://www.bar.com#Jamie" />
>   </ex:membership>
> </r:Description>
>
> I'm a bit confused about the semantics of each of the container
> representations in RDF.
>
 Me, too.  I do not know if this is different from the first or not.  Try it
with the validator and see what you think.

Cheers,

Tom P

Received on Monday, 26 May 2003 01:15:34 UTC