The Sixteen Faces of Eve

My goal in this posting, prompted by some email discussions on constrained profiles of RDF/XML, is to take three simple triples and see how many ways there were of serialising them as RDF/XML. I chose not to consider order of the elements to be significant - I may be mean but I'm not without a heart.

The triples I chose were trivial. In prose they are: "there is something that is a person, with a name of Eve and a homepage of http://example.org/~eve". In Turtle/NTriples/N3:

_:eve rdf:type foaf:Person .
_:eve foaf:name "Eve" .
_:eve foaf:homepage <http://example.org/~eve>.

When I started this posting I thought I could squeeze out seven RDF/XML serializations of the same three triples, so I had a clever name for the post all worked out. When I actually came to serialize the triples I came up with sixteen variations! It rather spoilt the joke but it sort of hammers home the point I'm trying to make.

Here's a challenge for a talented XPather: write an XPath that selects the homepage of the person with name "Eve". It must work with all sixteen of these serialisations.

Remember, all of these XML documents parse to the same three triples above. My maths is too rusty to work out how many serialisations there are of 4, 5, 6 or more triples let alone the few hundred that comprise my FOAF file.

Face 1:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <foaf:Person>
    <foaf:name>Eve</foaf:name>
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </foaf:Person>
</rdf:RDF>

Face 2:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description>
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
    <foaf:name>Eve</foaf:name>
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 3:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <foaf:Person foaf:name="Eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </foaf:Person>
</rdf:RDF>

Face 4:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description foaf:name="Eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 5:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <foaf:Person rdf:nodeID="eve">
    <foaf:name>Eve</foaf:name>
  </foaf:Person>
  <rdf:Description rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 6:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <foaf:Person rdf:nodeID="eve" foaf:name="Eve" />
  <rdf:Description rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 7:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
    <foaf:name>Eve</foaf:name>
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 8:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve" foaf:name="Eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 9:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve">
    <foaf:name>Eve</foaf:name>
  </rdf:Description>
  <foaf:Person rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </foaf:Person>
</rdf:RDF>

Face 10:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve">
    <foaf:name>Eve</foaf:name>
  </rdf:Description>
  <foaf:Person rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </foaf:Person>
</rdf:RDF>

Face 11:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve">
    <foaf:name>Eve</foaf:name>
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 12:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve" foaf:name="Eve" />
  <rdf:Description rdf:nodeID="eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 13:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve">
    <foaf:name>Eve</foaf:name>
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 14:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve" foaf:name="Eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
</rdf:RDF>

Face 15:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve">
    <foaf:name>Eve</foaf:name>
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
  </rdf:Description>
</rdf:RDF>

Face 16:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <rdf:Description rdf:nodeID="eve" foaf:name="Eve" />
  <rdf:Description rdf:nodeID="eve">
    <foaf:homepage rdf:resource="http://example.org/~eve"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="eve">
    <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" />
  </rdf:Description>
</rdf:RDF>

Permalink: http://blog.iandavis.com/2005/09/the-sixteen-faces-of-eve/


Other posts tagged as rdf

Earlier Posts