Re: Equality of RDF bags

On Oct 27, 2011, at 10:17 AM, Heiko Paulheim wrote:

> Dear RDF experts,
> 
> I have a question concerning the equivalence of rdf:Bags. Given the following RDF/XML document:
> 
> <?xml version="1.0"?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <rdf:Bag rdf:about="http://foo.bar/myBooks">
> <rdf:li rdf:resource="http://foo.bar/ABook"/>
> <rdf:li rdf:resource="http://foo.bar/AnotherBook"/>
> </rdf:Bag>
> </rdf:RDF>
> 
> Converting it to triples using the W3C RDF validator [1] yields
> 
> http://foo.bar/myBooks     http://www.w3.org/1999/02/22-rdf-syntax-ns#type     http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag
> http://foo.bar/myBooks     http://www.w3.org/1999/02/22-rdf-syntax-ns#_1     http://foo.bar/ABook
> http://foo.bar/myBooks     http://www.w3.org/1999/02/22-rdf-syntax-ns#_2     http://foo.bar/AnotherBook
> 
> Now, switching the order of the two <rdf:li ...> elements and running the validator again yields
> 
> http://foo.bar/myBooks     http://www.w3.org/1999/02/22-rdf-syntax-ns#type     http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag
> http://foo.bar/myBooks     http://www.w3.org/1999/02/22-rdf-syntax-ns#_1     http://foo.bar/AnotherBook
> http://foo.bar/myBooks     http://www.w3.org/1999/02/22-rdf-syntax-ns#_2     http://foo.bar/ABook
> 
> As far as I understand the graph equality definition given at [2], these two graphs are different, assuming that rdf#_1 and rdf#_2 are two different predicates. How does that go together with the idea that an rdf:Bag is unordered?

The graphs are different. However, the bags being described by the graphs might not be; they certainly contain the same elements, in any case. The numbers in the property names _1, _2, etc. should not be interpreted as imposing an order on the elements. They do in a seq, but not in a bag. But RDF only describes seqs and bags, it does not actually construct them. 

Pat Hayes

> 
> I am sure that I am missing a trivial point here, so I would be happy if someone could give me a hint.
> 
> Best regards,
> Heiko.
> 
> [1] http://www.w3.org/RDF/Validator/
> [2] http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-graph-equality
> 
> 

------------------------------------------------------------
IHMC                                     (850)434 8903 or (650)494 3973   
40 South Alcaniz St.           (850)202 4416   office
Pensacola                            (850)202 4440   fax
FL 32502                              (850)291 0667   mobile
phayesAT-SIGNihmc.us       http://www.ihmc.us/users/phayes

Received on Friday, 28 October 2011 05:21:40 UTC