Latest web development tutorials

RDF containers

RDF containers are used to describe a group of things. For example, the author of a book listed together.

The following RDF element is used to describe these groups: <Bag>, <Seq> and <Alt>.


h2> <rdf: Bag> element

<Rdf: Bag> element is used to describe a disorder defined as a list of values.

<Rdf: Bag> element can contain duplicate values.

Examples

<?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>


<Rdf: Seq> element

<Rdf: Seq> element is used to describe a list of regulations for the ordered values ​​(such as a sort alphabetically).

<Rdf: Bag> element can contain duplicate values.

Examples

<?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>


<Rdf: Alt> element

<Rdf: Alt> (user can select only one of these values) for a list of elements of alternative values.

Examples

<?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 have discussed the "list of values" in the description of the container element. In RDF, the "list of values" is known as a member (members).

Therefore, we can say:

  • A container is a resource that contains things
  • Things to be included are called members (it can not be called "list of values").