Skip to content

Instantly share code, notes, and snippets.

@nevali
Created April 26, 2011 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevali/942191 to your computer and use it in GitHub Desktop.
Save nevali/942191 to your computer and use it in GitHub Desktop.
RDF canonicalisation test
<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.com/ns#">
<!-- _:a <eg:x> _:b . _:b <eg:x> _:a . _:c <eg:x> _:b .
_:a <eg:x> _:c . _:b <eg:x> _:c . _:c <eg:x> _:a . -->
<rdf:Description rdf:ID="b">
<ex:x rdf:resource="#a" />
<ex:x rdf:resource="#c" />
</rdf:Description>
<rdf:Description rdf:ID="a">
<ex:x rdf:resource="#b" />
<ex:x rdf:resource="#c" />
</rdf:Description>
<rdf:Description rdf:ID="c">
<ex:x rdf:resource="#b" />
<ex:x rdf:resource="#a" />
</rdf:Description>
<rdf:Description rdf:ID="x">
<ex:x rdf:resource="#a" />
<!-- Note that if you modify this such that it points to #a, the resultant hash _must_ be different
- For example, consider the scenario where ex:x is actually owl:isDifferentFrom; if the following or
- preceding lines are modified such that they refer to the same thing, the meaning has altered.
-->
<ex:y rdf:resource="#b" />
</rdf:Description>
</rdf:RDF>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment