Answer: Using RDF container we can desribe the groups of things.Like: use to list artist of a movie, to create the list of author. I have given you some RDF element(<Bag>,<Seq> and <Alt>)that are used to describe groups.
1. <rdf:Bag> Element: It is used to describe a list of values that is intended to be unordered. <rdf:Bag> element can contain duplicate values. Example: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.r4r.in/cd#"> <rdf:Description rdf:about="http://www.r4r.in/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> 2. <rdf:Seq> Element: It is used to describe a list of values that is intended to be ordered. (Example: can define values in alphabetical order). <rdf:Seq> element can contain duplicate values. Example: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.r4r.in/cd#"> <rdf:Description rdf:about="http://www.r4r.in/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> 3.<rdf:Alt> Element: It is used to describe a list of alternative values(Using this user can select only one of the values). Example: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.r4r.in/cd#"> <rdf:Description rdf:about="http://www.r4r.in/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:Description> </rdf:RDF>
Question:
How to use Container element in RDF? Answer:
Using RDF container we can desribe the groups of things.Like: use to list artist of a movie, to create the list of author. I have given you some RDF element(<Bag>,<Seq> and <Alt>)that are used to describe groups.
1. <rdf:Bag> Element: It is used to describe a list of values that is intended to be unordered. <rdf:Bag> element can contain duplicate values. Example: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.r4r.in/cd#"> <rdf:Description rdf:about="http://www.r4r.in/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> 2. <rdf:Seq> Element: It is used to describe a list of values that is intended to be ordered. (Example: can define values in alphabetical order). <rdf:Seq> element can contain duplicate values. Example: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.r4r.in/cd#"> <rdf:Description rdf:about="http://www.r4r.in/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> 3.<rdf:Alt> Element: It is used to describe a list of alternative values(Using this user can select only one of the values). Example: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cd="http://www.r4r.in/cd#"> <rdf:Description rdf:about="http://www.r4r.in/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:Description> </rdf:RDF>