How to Design XML Documents
Aug 27 2:51:29
Back online!
Jul 30 16:17:53
Response to "Knowledge Management 2.0"
Jul 18 2:45:52
Drupal Apps
Jun 3 7:17:00
Google Sites and the AJAX universe
May 21 1:18:39
[Read my earlier post to understand why I object to RDF/XML, and the need for this replacement.]
R3 is an RDF dialect that is intended to be an isomorphic replacement for the RDF/XML dialect. In addition to the base syntax, R3 may be extended to allow inferences and relationships to be drawn on the basis of class (an alternative to the W3C Web Ontology Language (OWL)).
While a RELAX NG schema is planned, at present the language is primarily defined through a series of examples:
Example 1
<rdf xmlns="http://www.guruj.net/2007/01/19-r3-syntax#"
xmlns:meta="http://www.guruj.net/r3/meta#"
xmlns:x="http://www.guruj.net/r3/traits#"
xmlns:entity="http://www.example.com/objects#">
<node ref="entity:Muffin">
<has property="meta:label">Muffin, a cat</has>
<has property="x:eats" value="mice" />
</node>
</rdf>
[R3 definition of a cat.]
To create an RDF "graph", use the "target" attribute to indicate that the predicate points to a node rather than a literal value:
Example 2
<rdf xmlns="http://www.guruj.net/2007/01/19-r3-syntax#"
xmlns:meta="http://www.guruj.net/r3/meta#"
xmlns:x="http://www.guruj.net/r3/traits#"
xmlns:entity="http://www.example.com/objects#">
<node ref="entity:John+Smith">
<has property="meta:label">John Smith</has>
<has property="x:gender" value="male" />
<has property="x:owns" target="entity:Muffin" />
</node>
<node ref="entity:Muffin">
<has property="meta:label">Muffin, a cat</has>
<has property="x:eats" value="mice" />
</node>
</rdf>
[R3 definition of John, a male who owns a cat.]
Example 3 demonstrates the use of the <bag /> and <is /> tags. Bag is like <has />, but allows the easy assignment of a predicate to multiple objects. instead of <bag/>, you can use <alternative /> to specify "one of these" rather than "all". <sequence /> works identically to <bag /> but specifies that the order of listed properties is semantically significant.
Example 3
<rdf xmlns="http://www.guruj.net/2007/01/19-r3-syntax#"
xmlns:meta="http://www.guruj.net/r3/meta#"
xmlns:x="http://www.guruj.net/r3/traits#"
xmlns:entity="http://www.example.com/objects#">
<node ref="entity:Frieda+Daly">
<has property="meta:label">Frieda Daly</has>
<has property="x:gender" value="female" />
<bag property="x:owns">
<is target="entity:Snuggles" />
<is target="entity:Kensington" />
</bag>
</node>
<node ref="entity:Snuggles">
<has property="meta:label">Snuggles, a cat</has>
<has property="x:eats" value="mice" />
</node>
<node ref="entity:Kensington">
<has property="meta:label">Kensington, a cat</has>
<has property="x:eats" value="fish" />
</node>
</rdf>
[R3 definition of Frieda, a female who owns two cats.]
So why consider R3 instead of standard RDF/XML? I would cite three main advantages:
[An introduction to classes in R3 is now also available.]