Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

RDF Tutorial
RDF Introduction
RDF Model
Concepts in RDF
XML Syntax for RDF
An Example for RDF
RDF Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


XML Syntax for RDF

Previous Next



This section describes XML syntax. It uses the XML namespace notations, but the expanded names are obtained simply by concatenating a namespace to an element name. Hence we will use same convention as in the previous section for prefixes RDF: and RDFS:.


The Description

An RDF document is the list of descriptions. Usually each description applies to one resource, and contains the list of properties. Property values are either the URIs, literals or any other Descriptions.

In XML, the RDF meta-data are embedded in the element named "rdf:RDF". This element do contains the sequence of elements named RDF:Description. Those elements can have one of the two attributes either RDF:about or the RDf:ID (but not both of them).

  • RDF:about is used to describe any of the resource; its value is either an absolute URI or the relative URI.
  • <RDF:Description about="http://vyom.co.in/index.html">
    ...
    </RDF:Description>
  • RDF:ID is used to define the resource; its value is the fragment identifier (without "#" character) to be added to an XML document URI. The resource may not be defined more than once.
  • <RDF:Description ID="foo">
    ...
    </RDF:Description>
  • The description without an RDF:about nor RDF:ID is said to describe an anonymous resource.
  • <RDF:Description>
    ...
    </RDF:Description>

    An element RDF:Description contains the sequence of XML elements. Those elements are interpreted as the properties, whose predicate's URI is an expanded name of the element. If an element is empty, it should have an attribute RDF:resource whose value is the object's URI (see dc:Creator in the fig below). Else, it can contain the plain text (then is interpreted as a literal - see dc:Title in the fig below) or a single embedded RDF:Description element (see dc:Creator in the fig below).


    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dc="http://purl.org/DC/"
    xmlns:os="http://somesite.org/Schema/">
    <rdf:Description about="http://vyom.co.in/index.html">
    <dc:Creator rdf:resource="mailto:am@vyom.co.in"/>
    <dc:Title> Index of my web site </dc:Title>
    <dc:Creator>
    <rdf:Description about="mailto:champin@vyom.co.in">
    <os:worksWith rdf:resource="mailto:am@vyom.co.in"/>
    </rdf:Description>
    </dc:Creator>
    </rdf:Description>
    </rdf:RDF>

    In case of an ambiguity, the attribute RDF:parseType can be used in the property elements with a "Resource" or a "Literal" value. The latter can be used when the literal contains XML tags, to prevent being parsed as an description.

    The syntax might also be abbreviated in two ways:

    • Description elements name can be replaced by any URI. It is interpreted as additional RDF:type property, valued by a named resource. Note that the context always allows to differ the typed description element from the property element.
    • properties with the literal values can be written as attributes for the description elements rather than the embedded elements.

    Consider for an example, the following description:

    <rdf:Descritpion ID="fatherOf">
    <rdf:type rdf:resource=
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
    <rdf:label> father of <rdfs:subPropertyOf rdf:resource="#parentOf">
    </rdf:Descritpion>

    This can be abbreviated into

    <rdf:Property ID="fatherOf" rdfs:label="father of">
    <rdfs:subPropertyOf rdf:resource="#parentOf">
    </rdf:Descritpion>


    The Containers

    As mentioned earlier RDF containers are defined as the part of XML syntax. A container node is described with the special element named RDF:Bag, RDF:Seq or the RDF:Alt (those elements can be used instead of the RDF:Description elements). Those special descriptions can only have the RDF:ID attribute or be anonymous, they cannot have the RDF:about.

    The Membership properties are not been used as is, but instead the element RDF:li is used; the parser has to replace it by appropriate numbered property. Figure given below is an example of it.

    <?xml version="1.0" encoding="UTF-8" ?>
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <rdf:Bag ID="mybag">
    <rdf:li resource="http://vyom.co.in/index.html"/>
    <rdf:li resource="mailto:champin@vyom.co.in"/>
    <rdf:li> literal element </rdf:li>
    </rdf:Bag>
    </rdf:RDF>


    The Distributed Descriptions

    Instead of the RDF:about, descriptions can also have the attribute RDF:aboutEach or the RDF:aboutEachPrefix. This allows to distribute the description over the set of resources.

    • RDF:aboutEach's value should be a container's URI; the corresponding description applies to every member of a container.
    • RDF:aboutEachPrefix's value is the string; corresponding description applies to any of the resource whose URI starts with this string.

    The Implementations of the RDF are not bound only to keep the information about those distributive descriptions - this is only the syntactic shortcut. It may result in the unexpected behaviours of some agents, as soon as more than one RDF source is been involved (resources defined in the source can match the distributed description in another one, but not been detected as such).

    Moreover, it is not been specified whether the distributed description may be embedded as the property values. Though this possibility is never been mentioned, the formal syntax allows it. The natural interpretation would be that the property is valued by every resource matching an distributed description.


    The Reification

    XML syntax of the RDF provides a way to reify the asserted statements: the single arc can be reified by adding the RDF:ID attribute to an property element, which will define the URI of a reified statement. On the other hand, every arc generated by the description can be reified by adding the RDF:bagID attribute to Description. This defines an URI of the new bag resource, whose members are a reified statements.




    Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
    • blinkbits
    • BlinkList
    • blogmarks
    • co.mments
    • connotea
    • del.icio.us
    • De.lirio.us
    • digg
    • Fark
    • feedmelinks
    • Furl
    • LinkaGoGo
    • Ma.gnolia
    • NewsVine
    • Netvouz
    • RawSugar
    • Reddit
    • scuttle
    • Shadows
    • Simpy
    • Smarking
    • Spurl
    • TailRank
    • Wists
    • YahooMyWeb

    Previous Next

    Keywords: rdf model, resource description framework xml, rdf statements, rdf schema


    HTML Quizes
    HTML Quiz
    XHTML Quiz
    CSS Quiz
    TCP/IP Quiz
    XML Quizes
    XML Quiz
    XSL Quiz
    XSLT Quiz
    DTD Quiz
    Schema Quiz
    XForms Quiz
    XSL-FO Quiz
    XML DOM Quiz
    XLink Quiz
    XQuery Quiz
    XPath Quiz
    XPointer Quiz
    RDF Quiz
    SOAP Quiz
    WSDL Quiz
    RSS Quiz
    WAP Quiz
    Web Services Quiz
    Browser Scripting Quizes
    JavaScript Quiz
    VBScript Quiz
    AJAX Quiz
    DHTML Quiz
    HTML DOM Quiz
    WMLScript Quiz
    E4X Quiz
    Server Scripting Quizes
    ASP Quiz
    PHP Quiz
    PERL Quiz
    SQL Quiz
    ADO Quiz
    .NET (dotnet) Quizes
    Microsoft.Net Quiz
    XML Web Services Quiz
    ASP.Net Quiz
    .Net Mobile Quiz
    C# : C Sharp Quiz
    ADO.NET Quiz
    VB.NET Quiz
    Multimedia Quizes
    SVG Quiz
    Flash Quiz
    Media Quiz
    SMIL Quiz
    Web Building  Quizes
    Web Browsers Quiz
    Web Hosting Quiz
    W3C Quiz
    Web Building Quiz
    Web Quality Quiz
    Web Semantic Quiz
    Web Careers Quiz
    Java Quizes
    Java Quiz
    JSP Quiz
    Servlets Quiz
    Struts Quiz
    EJB Quiz
    JMS Quiz
    JMX Quiz
    Programming Langauges Quizes
    C Quiz
    C++ Quiz
    Visual Basic Quiz
    Data Structures Using C Quiz
    Soft Skills Quizes
    Communication Skills Quiz
    Time Management Quiz
    Project Management Quiz
    Team Work Quiz
    Leadership Skills Quiz
    Corporate Communication Quiz
    Negotiation Skills Quiz

    Privacy Policy
    Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.