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?
RDF containers are used to describe group of things. For example, to list the authors of a book or to list the members in a band. The following RDF elements are used to describe such groups: <Bag>, <Seq>, and <Alt>.
RDF collections are used to describe groups that contains ONLY the specified members.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With