RDF
container
Elements
You can use RDF container elements to describe a set of things, and this section describes the three RDF elements used to describe these groups.
RDF containers are used to describe a set of things.
For example, list the authors of a book.
The following RDF elements are used to describe these groups: .
the elements of the .lt;rdf:Bag>
The element is used to describe a list of values that are specified as out of order.
The element can contain duplicate values.
Instance
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Beatles">
<cd:artist>
<rdf:Bag>
<rdf:li>John</rdf:li>
<rdf:li>Paul</rdf:li>
<rdf:li>George</rdf:li>
<rdf:li>Ringo</rdf:li>
</rdf:Bag>
</cd:artist>
</rdf:Description>
</rdf:RDF>
The element of the seq.gt
The element is used to describe a list of values that are specified as orderly (such as an alphabetical order).
The element can contain duplicate values.
Instance
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Description
rdf:about="http://www.recshop.fake/cd/Beatles">
<cd:artist>
<rdf:Seq>
<rdf:li>George</rdf:li>
<rdf:li>John</rdf:li>
<rdf:li>Paul</rdf:li>
<rdf:li>Ringo</rdf:li>
</rdf:Seq>
</cd:artist>
</rdf:Description>
</rdf:RDF>
The element of the .lt;rdf:Alt>
The element is used for a list of replaceable values (users can only select one of these values).
Instance
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
<rdf:Descriptio
rdf:about="http://www.recshop.fake/cd/Beatles">
<cd:format>
<rdf:Alt>
<rdf:li>CD</rdf:li>
<rdf:li>Record</rdf:li>
<rdf:li>Tape</rdf:li>
</rdf:Alt>
</cd:format>
</rdf:Descriptio>
</rdf:RDF>
RDF term
In the example above, we discussed a "list of values" when describing container elements.
In RDF, these "lists of values" are called members.
So we can say this:
-
A container is a resource that contains things
-
The contained thing is called a member (not a "list of values").
These are the usage and examples of the three RDF container elements described in this section.