Latest web development tutorials

RDF instance

RDF instance

This is one of a few lines of a CD list:

标题 艺术家 国家 公司 价格 年份
Empire Burlesque Bob Dylan USA Columbia 10.90 1985
Hide your heart Bonnie Tyler UK CBS Records 9.90 1988

This is one of a few lines of an RDF document:

<?xml version="1.0"?>

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">

<rdf:Description
rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
<cd:artist>Bob Dylan</cd:artist>
<cd:country>USA</cd:country>
<cd:company>Columbia</cd:company>
<cd:price>10.90</cd:price>
<cd:year>1985</cd:year>
</rdf:Description>

<rdf:Description
rdf:about="http://www.recshop.fake/cd/Hide your heart">
<cd:artist>Bonnie Tyler</cd:artist>
<cd:country>UK</cd:country>
<cd:company>CBS Records</cd:company>
<cd:price>9.90</cd:price>
<cd:year>1988</cd:year>
</rdf:Description>
.
.
.
</rdf:RDF>

This document is the first line of RDF XML declaration. After this declaration is the root element RDF XML document: <rdf: RDF>.

xmlns: rdf namespace defines the elements with the prefix rdf from namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#".

xmlns: cd namespace, specifies the elements with the prefix cd from the namespace "http: //www.recshop.fake/cd#".

<rdf: Description> element contains to be rdf: about attribute identifies the resource description.

Element: <cd: artist>, < cd: country>, <cd: company> and so is the property of this resource.


RDF validator Online

The W3C RDF validation service is very helpful when you learn RDF. Here you can test RDF file.

RDF online validator can resolve your RDF document, which checks the syntax and generates tabular and graphical views for your RDF document.

Copy and paste the following example to the W3C RDF validator:

<?xml version="1.0"?>

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:si="http://www.w3schools.com/rdf/">
<rdf:Description rdf:about="http://www.w3schools.com">
<si:title>W3Schools.com</si:title>
<si:author>Jan Egil Refsnes</si:author>
</rdf:Description>
</rdf:RDF>

After you parse the example above, the result will be like this.