RDF Example











<?xml version="1.1">
<!DOCTYPE rdf:RDF [
  <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
]>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:computer="http://www.mycomputer.org/photo#"
         xmlns:processor="http://www.intel.com/core2duo#">

  <rdf:Description rdf:about="MacBookAir">
    <computer:processor>IntelCore2Duo</computer:processor>
    <computer:processor rdf:resource="IntelCore2Duo" /> 
    <computer:hasDisc rdf:resource="PATAHardDisc" />
    <computer:screen>LCD</computer:screen>
    <computer:weight http://www.w3.org/2001/XMLSchema#decimal>3.0</computer:weight>
    <computer:weight rdf:datatype="&xsd;decimal">3.0</computer:weight>
    <computer:hasPrice>
      <rdf:value>1799</rdf:value>
      <rdf:type>US Dollars</rdf:type>
    </computer:hasPrice>
    <computer:comesInColours>
      <rdf:Description rdf:nodeID="availableColours">
        <colour:1>Black</colour:1>
        <colour:2>White</colour:2>
        <colour:3>Grey</colour:3>
      </rdf:Description>
    </computer:comesInColours>
    <rdf:Alt rdf:about="alternatives">
    <rdf:Bag rdf:about="alternatives">
    <rdf:Seq rdf:about="alternatives">
      <rdf:_1>Sony VaioTZ</rdf:_1>
      <rdf:_2>Asus Eee PC</rdf:_2>
      <rdf:li>Sony VaioTZ</rdf:li>
      <rdf:li>Asus Eee PC</rdf:li>
    </rdf:Alt>
    </rdf:Bag>
    </rdf:Seq>
  </rdf:Description>
  	
  <rdf:Description rdf:about="computer">
    <computer:hasType rdf:parseType="Collection">
      <rdf:Description rdf:about="Desktop">
      <rdf:Description rdf:about="Laptop">
    </computer:hasType>
  </rdf:Description>
  	
  <rdf:Statement rdf:about="StatementAboutMacBookAir">
    <rdf:subject rdf:resource="MacBookAir" />
    <rdf:predicate rdf:resource="&computer:operatingSystem" />
    <rdf:object rdf:resource="Leopard" />
    <computer:statedBy rdf:resource="Apple">
  </rdf:Statement>
  	
  <rdf:Description rdf:about="IntelCore2Duo">
    <processor:soldBy>Intel</processor:soldBy>
  </rdf:Description>
  
</rdf:RDF>

Code adapted from Agency and the Semantic Web by Walton (2007), p26.