Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

How you define elements in RDF?
 Their are two main elements in RDF that are <RDF> and <Description> element. These element are use to identify the source.
1.<rdf:RDF> Element is an root element of RDF document which is use to identify XML document to be an RDF document.This element is also use to contain a reference of RDF namespace.
Syntax:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
.
Write here description
.
</rdf:RDF>

2.<rdf:Description> Element is used to identify a resource with attribute.
<rdf:Description> element has elements using this we can describe the resource.
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/The Reader">
  <cd:artist>Kate Winslet</cd:artist>
  <cd:country>USA</cd:country>
  <cd:price>11.80</cd:price>
</rdf:Description>
</rdf:RDF>

 In the above example elements, artist, country, and price are defined in http://www.r4r.in/cd# namespace. This namespace is not the part of RDF means outside the RDF.RDF used only to define the framework. The elements artist, country and price should be defined by someone else like: company, organization, person etc.).
Posted By: Name:Rajesh Kr URL: How you define elements in RDF?