Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

RDF Containers

RDF Container Elements


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

The following RDF elements are used to describe these groups: , and .


rdf:Bag Element

rdf:Bag element is used to describe a list of values specified as unordered.

rdf:Bag element may contain duplicate values.

Example

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:cd="http://www.recshop.fake/cd#">

rdf:about="http://www.recshop.fake/cd/Beatles">

  cd:artist

    rdf:Bag

      rdf:liJohn

      rdf:liPaul

      rdf:liGeorge

      rdf:liRingo

   

 


rdf:Seq Element

rdf:Seq element is used to describe a list of values specified as ordered (such as an alphabetical sort).

rdf:Bag element may contain duplicate values.

Example

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:cd="http://www.recshop.fake/cd#">

rdf:about="http://www.recshop.fake/cd/Beatles">

  cd:artist

    rdf:Seq

      rdf:liGeorge

      rdf:liJohn

      rdf:liPaul

      rdf:liRingo

   

 


rdf:Alt Element

rdf:Alt element is used for a list of alternative values (the user can choose only one of these values).

Example

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:cd="http://www.recshop.fake/cd#">

rdf:about="http://www.recshop.fake/cd/Beatles">

  cd:format

    rdf:Alt

      rdf:liCD

      rdf:liRecord

      rdf:liTape

   

 


RDF Terminology

In the example above, we discussed "lists of values" when describing container elements. In RDF, these "lists of values" are called members.

Therefore, we can say: