ZVON > Tutorials > RDF Tutorial
>> Example 15 << | Prev | Next | Contents

Description


In the previous Example 14 we said that the author wrote a collection of given books. We did not speak about individual books only about the collection. In this example we want to say who is the author of each book. We will use aboutEach instead of about attribute.

Source


<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:lib="http://www.zvon.org/library">

     <lib:Author aboutEach="#RDbooks">
          <lib:firstName>Roald</lib:firstName>
          <lib:surname>Dahl</lib:surname>
     </lib:Author>
          
     <rdf:Description aboutEach="#JCbooks">
          <rdf:type resource="http://www.zvon.org/library/Author"/>
          <lib:firstName>Joseph</lib:firstName>
          <lib:surname>Conrad</lib:surname>
     </rdf:Description>

     <rdf:Bag ID="RDbooks">
          <rdf:_1 resource="Matilda"/>
          <rdf:_2 resource="The BFG"/>
     </rdf:Bag>


     <rdf:Bag ID="JCbooks">
          <rdf:li resource="Heart of Darkness"/>
          <rdf:li resource="Lord Jim"/>
          <rdf:li resource="The Secret Agent"/>
     </rdf:Bag>          

                    
</rdf:RDF>

Output Top


Matilda was written by Roald Dahl
The BFG was written by Roald Dahl
Heart of Darkness was written by Joseph Conrad
Lord Jim was written by Joseph Conrad
The Secret Agent was written by Joseph Conrad