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
[For the basics of R3 syntax, see the R3 Draft.]
One of the primary things which makes semantic markup useful is that it allows inferences and deductions based upon knowledge. For example, if I know that John is the father of Susan, and Greg is the brother of Susan, then I can create semantic rules like this:
A brother is a male sibling The father of a sibling is the sibling's father.
and deduce from these rules that John is Greg's father.
R3 allows for these kind of relationships to be expressed through using special nodes that are known to belong to an ontology schema. R3 syntax remains exactly the same except for the introduction of a <template/> tag, which defines spaces for placeholders which need to be filled in accordance with certain critera for a relationship to hold. For example:
Example 1
<rdf xmlns="http://www.guruj.net/2007/01/19-r3-syntax#"
xmlns:meta="http://www.guruj.net/r3/meta#"
xmlns:ol="http://www.guruj.net/r3/ontology#"
xmlns:class="http://www.example.com/classes#"
xmlns:entity="http://www.example.com/objects#"
xmlns:x="http://www.example.com/traits#">
<node ref="class:pet+owner">
<has property="meta:label">pet owner</has>
<has property="ol:class" target="class:person" />
<has property="x:has_pet">
<ol:template>
<has property="ol:class" target="class:animal" />
</ol:template>
</has>
</node>
<node ref="class:cat">
<has property="meta:label">cat</has>
<has property="ol:class" value="class:animal" />
</node>
["Pet owners" are people who have an animal as a pet.]
These two R3 nodes define semantic nodes which define classes. Classes define properties of entities (a fancy way of saying, "instances of things") and constraints for an entity to be considered a member of a class.
An instance of a pet owner entity might look like this:
Example 2 <node ref="entity:Walt"> <has property="meta:label">Walt</has> <has property="ol:class" target="class:person" /> <has property="x:has_pet" target="entity:Fluffy" /> </has> <node ref="entity:Fluffy"> <has property="meta:label">Fluffy <has property="ol:class" target="class:person" /> <has property="x:has_pet" target="entity:Huey" /> </has> [Walt, a pet owner. Note that he is not marked explicitly as a pet owner -- it is inferred from the class definitions.]