RDF Example
RDF Example
Here are a few rows of a CD list:
| Title | Artist | Country | Company | Price | Year |
|---|---|---|---|---|---|
| Empire Burlesque | Bob Dylan | USA | Columbia | 10.90 | 1985 |
| Hide your heart | Bonnie Tyler | UK | CBS Records | 9.90 | 1988 |
Here are a few rows of an RDF document:
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/Empire Burlesque"> cd:artistBob Dylan cd:countryUSA cd:companyColumbia cd:price10.90 cd:year1985 rdf:about="http://www.recshop.fake/cd/Hide your heart"> cd:artistBonnie Tyler cd:companyCBS Records cd:price9.90 cd:year1988 . . .
The first line of this RDF document is the XML declaration. After this XML declaration comes the root element of the RDF document:rdf:RDF.
xmlns:rdf namespace, which specifies that elements with the rdf prefix come from the namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#".
xmlns:cd namespace, which specifies that elements with the cd prefix come from the namespace "http://www.recshop.fake/cd#".
rdf:Description element contains a description of the resource identified by the rdf:about attribute.
element:cd:artist, cd:country, cd:company and so on are the properties of this resource.
RDF Online Validator
W3C's RDF Validation ServiceIt is very helpful when you are learning RDF. Here you can experiment with RDF files.
The RDF online validator can parse your RDF document, check its syntax, and generate tabular and graphical views of your RDF document.
Copy and paste the example below into W3C's RDF validator:
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:si="http://www.runoob.com/rdf/"> si:titlerunoob.com si:authorJan Egil Refsnes
After you parse the example above, the result will look similar to this.