W3C home > Mailing lists > Public > www-rdf-interest@w3.org > December 2000

One-page tutorial on RDF

From: Graham Klyne <GK@Dial.pipex.com>
Date: Wed, 20 Dec 2000 11:35:52 +0000
Message-Id: <4.3.2.7.2.20001220112844.00bcc2c0@pop.dial.pipex.com>
To: RDF interest group <www-rdf-interest@w3.org>
Folks,

I find myself more often being asked to present RDF in simple terms:  here 
is something I put together recently in response to one such question.

Comments?

#g
--

Broadly, RDF maps a directed labelled graph (DLG) data model onto XML.  The 
graph nodes and arcs are labelled using URIs.

It also turns out that a relational data model is also easily mapped onto 
this form, with a node corresponding to a table row or primitive value, and 
an arc corresponding to a column identifier.

The RDF syntax defines a number of forms for XML that are easily mapped 
onto the DLG structure.  The basic RDF syntax can be rather cumbersome, but 
if one assumes schema-aware RDF processing (or a special-purpose 
processor), it is possible to design a reasonably neat RDF-compatible form 
of XML for a typical application.

RDF does allow XML attributes to be used for arc names, but the syntax can 
get very confusing.  I'd suggest designing the format with just XML 
elements initially, then mapping that to an attributes-as-arcs form 
later.  Hopefully, the result will be very close to an XML format one might 
design for a specific application, with the possible benefit of a more 
regular structure.

RDF XML syntax can use XML elements to name both graph nodes and arcs:  one 
tends to end up with an alternating nesting structure:

    <Node-type-1 about="Node-name-1">
       <arc-label-1>
          <Node-type-2 about="Node-name-2">
             <arc-label-2>
                value
             </arc-label-2>
           :
          </Node-type-2>
       </arc-label-1>
       <arc-label-3>
          <Node-type-3 about="Node-name-3">
           :
          </Node-type-3>
       </arc-label-3>
        :
    </Node-type-1>

Representing (best viewed with non-proportional font...):

   [Node-name-1]
    |
    +--rdf:type-----> [Node-type-1]
    +--arc-label-1--> [Node-name-2]
    |                  |
    |                  +--rdf:type-----> [Node-type-2]
    |                  +--arc-label-2--> "value"
    |                  :
    |
    +--arc-label-3--> [Node-name-3]
    |                  |
    |                  +--rdf:type-----> [Node-type-3]
    |                  :
    :

Where:
  [x]    denotes a resource named 'x' (e.g. a table row),
  "foo"  denotes a literal value (e.g. a column value in a row), and
  --y--> denotes a property named 'y' (e.g. a column name).

I'm trying to show here that the basic structure of RDF is very simple, 
even if the XML syntax (and the RDF specification) can be very confusing.

--end--
------------
Graham Klyne
(GK@ACM.ORG)
Received on Wednesday, 20 December 2000 07:01:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:47 GMT