Simplified Surface Syntax for RDF XML

Jonathan Borden Tufts University School of Medicine, The Open Healthcare Group

A simplified surface syntax for RDF is proposed. Its major characteristics are:

  1. namespace = http://www.openhealth.org/RDF/RDFSurfaceSyntax-20010617
  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 qualified name, a quantified variable or another statement.
  7. ?x defines a quantified variable, ...x a row variable

Syntax

The surface 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:

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

=>