Simplified XML Syntax for RDF

Jonathan Borden Tufts University School of Medicine, The Open Healthcare Group This version: June 17, 2001

Latest version

A simplified XML syntax for RDF is proposed. Its major differences with RDF 1.0 are:

  1. namespace = http://www.openhealth.org/RDF/RDFSurfaceSyntax
  2. defined as tree regular expression
  3. attribute aboutQ="ex:name" accepts QName as value indicating subject
  4. attribute resourceQ="ex:value" accepts QName as value indicating object
  5. rdf:parseType="Resource" is default
  6. The subject or object of a statement may be either a URI reference, a qualified name, a quantified variable, another statement or a collection of statements.
  7. ?x defines a quantified variable

XML Syntax

The XML syntax for RDF 1.0 can be described in terms of a tree regular expression. This form can be thought of as expressing constraints on the XML Infoset which arises when parsing an RDF document. The advantage of expressing the syntax in this form over EBNF, is that a tree regular expression (e.g RELAXNG/TREX schema http://relaxng.org ) already takes into account the rules of XML syntax + XML namespaces, e.g. correctly handles namespace prefixes, empty elements, mixed content, whitespace, attribute ordering etc. Such schemata are also described as "hedge regular expressions" or "hedge automata" http://www.oasis-open.org/cover/hedgeAutomata.html.

The tree regular expression schema for RDF 1.0 is available here. This schema handles several proposed updates such as the requirement that the "rdf:about" and "rdf:ID" attributes be prefixed/qualified.

A tree regular expression for the proposed syntax is available here.

The obj pattern is described thus:

<define name="obj">
 <choice>
  <ref name="description"/>
  <ref name="container"/>
 </choice>
</define>

The description, container, idAboutAttr, idAttr patterns are described thus:

<define name="description">
 <choice>
   <element name="Description">
     <optional>
         <ref name="idAboutAttr"/>
     </optional>
     <optional>
         <ref name="bagIdAttr"/>
     </optional>
     <zeroOrMore>
         <ref name="propAttr"/>
      </zeroOrMore>
   </element>
   <ref name="typedNode"/>
 </choice>
</define>

 <define name="container">
 <choice>
     <ref name="sequence"/>
     <ref name="bag"/>
     <ref name="alternative"/>
 </choice>
</define>

<define name="idAboutAttr">
 <choice>
     <ref name="idAttr"/>
     <ref name="aboutAttr"/>
     <ref name="aboutQAttr"/>
 </choice>
</define>

<define name="idAttr">
  <attribute name="rdf:ID">
     <data type="ID"/>
  </attribute>
</define>

An example:

         <r:RDF xmlns:r="http://www.openhealth.org/RDF/SurfaceSyntax"
                  xmlns:ex="http://example.org/ex">
           <r:Description r:aboutQ="ex:Jon">
            <ex:says>
             <ex:color r:aboutQ="ex:sky" r:resourceQ= "ex:blue"/>
            </ex:says>
           </r:Description>
         </r:RDF>
   

=>

Parsers

XSLT

An XSLT parser is available here which transforms an RDF document into Statement form.

Jonathan Borden ENS ENI