RDF Triples in XML

Carroll & Stickler

Semantic Web Interest Group

1-2 March 2004

Goals

New XML serialization for RDF.

  1. Format Serilizes the Graph
  2. XML friendly: (small, closed tag set)
  3. Minimalist

DTD and XML Schema

Two Non-Minimalist Features

Graph Naming
Patrick insisted on some mechanism for contexts.
Jeremy proposed graph naming, in line with minimalism.
Not discussed in this presentation.
XSLT usage
syntactic fairy godmother

Example

<graphset xmlns="http://example.org/TriX/">
<graph>
   <triple>
      <uri>http://example.org/Bob</uri>
      <uri>http://example.org/wife</uri>
      <uri>http://example.org/Mary</uri>
   </triple>
   <triple>
      <uri>http://example.org/Bob</uri>
      <uri>http://example.org/wife</uri>
      <plainLiteral>Bob</plainLiteral>
   </triple>
   <triple>
      <uri>http://example.org/Mary</uri>
      <uri>http://example.org/age</uri>
      <typedLiteral datatype="http://www.w3.org/2001/XMLSchema#integer">32</typedLiteral>
   </triple>
   <triple>
      <id>x</id>
      <uri>http://example.org/width</uri>
      <typedLiteral datatype="http://example.org/int">46</typedLiteral>
   </triple>
</graph>
</graphset>

Naming Example

<graph>
   <id>binfo</id>
   <triple>
      <uri>http://example.org/aBook</uri>
      <uri>http://purl.org/dc/elements/1.1/title</uri>
      <typedLiteral datatype="http://www.w3.org/2000/01/rdf-schema#XMLLiteral"><ex:title>A Good Book</ex:title></typedLiteral>
   </triple>
   <triple>
      <id>binfo</id>
      <uri>http://example.org/source</uri>
      <uri>http://example.org/book-description.rdf</uri>
   </triple>
</graph>

QName and XSD Example

QNames not allowed in TriX

<?xml-stylesheet type="text/xml" href=
   "http://jena.sourceforge.net/TriX/all.xsl"
     ?>

<graphset>
<graph>
   <triple>
      <qname> eg:Bob </qname>
      <qname> eg:wife </qname>
      <qname> eg:Mary </qname>
   </triple>
   <triple>
      <qname> eg:Bob </qname>
      <qname> eg:name </qname>
      <plainLiteral>Bob</plainLiteral>
   </triple>
   <triple>
      <qname> eg:Mary </qname>
      <qname> eg:age </qname>
      <integer> 32 </integer>
   </triple>
</graph>
<graphset>

Further Extensions

Discussion Point

We should have TriX or similar for XML compatibility. May or may not be RDF/XML replacement.

Key features: