8

I have read from a book

The difference between containers and collections lies in the fact that containers are always open (i.e., new members may be added through additional RDF statements) and collections may be closed.

I don't understand this difference clearly. It says that no new members can be added to a collection. What if I change the value of the last rdf:rest property from rdf:nil to _:xyz and add

_:xyz rdf:first <ex:aaa> .
_:xyz rdf:rest rdf:nil .

I am thus able to add a new member _:xyz. Why does it then say that collections are closed?

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
Haya Hallian
  • 153
  • 2
  • 11
  • 1
    A note: when you add `_:xyz rdf:first ; rdf:rest rdf:nil`, the element that you're adding to the list is ``, not `_:xyz`. The node `_:xyz` is part of the _structure_ of the list, the `` is one of the _elements_ of the list. – Joshua Taylor Jul 11 '13 at 11:42
  • Yes you are right. Thanks for correction :) – Haya Hallian Jul 11 '13 at 12:34

1 Answers1

16

The key difference is that in a Container, you can simply continue to add new items, by only asserting new RDF triples. In a Collection, you first have to remove a statement before you can add new items.

This is an important difference in particular for RDF reasoning. It's important because RDF reasoning employs an Open World Assumption (OWA), which, put simply, states that just because a certain fact is not known, that does not mean we can assume that fact to be untrue.

If you apply this principle to a container, and you ask the question "how many items does the container have", the answer must always be "I don't know", simply because there is no way to determine how many unknown items might be in the container. However, if we have a collection, we have an explicit marker for the last item, so we can with certainty say how many items the collection contains - there can be no unknown additional items.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • 3
    The sections [3.3.2 RDF containers](http://www.w3.org/TR/rdf-mt/#Containers) and [3.3.3 RDF collections](http://www.w3.org/TR/rdf-mt/#collections) of the [RDF Semantics W3C Recommendation](http://www.w3.org/TR/rdf-mt/) are also good resources. – Joshua Taylor Jul 11 '13 at 11:45