From W3C Wiki


Using the general RDF/XML spec, the RDF serialization can look quite different depending on rdf-writer implementation. These diversity in writing RDF makes writing XSLT transformation a black art. What happens is that the data shows up in so many different ways, that many people write big hacks to get it work.

Solution: a simple RDF/XML syntax that is RDF/XML compatible but has some restrictions to it. It is kind-of deterministic and can be better parsed in XSLT. I [LeoS] call it SimpleRdfXml.

See Also


This is a fragment of FOAF, using the simpleRDF/XML

    xmlns:dc="" >
  <rdf:Description rdf:about="">
    <rdf:type rdf:resource=""/>
    <rdfs:comment>The first name of a person.</rdfs:comment>
    <rdf:type rdf:resource=""/>
    <rdfs:domain rdf:resource=""/>
    <rdfs:range rdf:resource=""/>
    <rdfs:isDefinedBy rdf:resource=""/>

Design Rules of SimpleRdfXml

  1. be compatible with RDF/XML
  2. but only a subset
  3. restrict to simplicity


  1. no nested elements (references to resources must be done via rdf:resource)
  2. all literals as XML nodes <foaf:name>Hello!</foaf:name> and not XML attributes <blub foaf:name="Hello!">
  3. Blank nodes must be identified via rdf:nodeID, the abbreviation with rdf:parseType="Resource" is discouraged.
  4. only full uris, no relative
  5. Type always as rdf:type triple, not as the name of the XML element
  6. Gather all triples of a resource to one element


The blank nodes rule was relaxed, before 19.10.2007 we required that blank nodes must be replaced with URIs. But that would break the standard.


Using Jena, the easiest way to get it is:

simple rdf:
Model m = ...;
m.write(System.out, "RDF/XML");

bad rdf:
m.write(System.out, "RDF/XML-ABBREV");

more detail

No nested stuff

All literals as elements, not attributes

Querying from XSLT is easy with both, but having to check both all the time sucks. Most hackers go with the element solution, as it can contain datatypes and languages and can have better strings with CDATA elements.


In foaf-vocab, there is a uri called "../sig" which is the show-stopper. don't do it

Type always as triple

Wrong: <foaf:Person rdf:about="urn:example"> Right:

<rdf:Description rdf:about="urn:example">
  <rdf:type rdf:resource=""/>

When things have two types, this comes in handy. Again, a step for making it simpler. (I feel this constraint makes it a lot harder for humans to read, so I don't know if that's the right kind of simplicity KjetilKjernsmo)

Gather all triples of a resource

<rdf:Description rdf:about="urn:example">
  <rdf:type rdf:resource=""/>
<rdf:Description rdf:about="urn:example">

<rdf:Description rdf:about="urn:example">
  <rdf:type rdf:resource=""/>


This RDF is BAD RDF and is not simple, it breaks the rules: nono:

<foaf:Person rdfs:label="blub">
  <rdf:hasblub >