Rules have variables, so treating them as a semantic extension of RDF is very difficult. It is, however, still possible to provide an RDF syntax for rules---it is just that the semantics of the resultant RDF graphs will not be an extension of the RDF Semantics. A mapping to RDF/XML is most easily created as an extension to the XSLT transformation for the OWL XML Presentation syntax.
These examples illustrate a suitable rules extension of the OWL RDF/XML syntax. The first example is a repetition of Example 5.1-2 using RDF/XML syntax:
<owlr:Variable rdf:ID="_x1"/> <owlr:Variable rdf:ID="_x2"/> <owlr:Variable rdf:ID="_x3"/> <owlr:Rule> <owlr:antecedent rdf:parseType="Collection"> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="⪚hasParent"/> <owlr:argument1 rdf:about="#_x1" /> <owlr:argument2 rdf:about="#_x2" /> </owlr:individualPropertyAtom> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="⪚hasSibling"/> <owlr:argument1 rdf:about="#_x2" /> <owlr:argument2 rdf:about="#_x3" /> </owlr:individualPropertyAtom> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="⪚hasSex"/> <owlr:argument1 rdf:about="#_x3" /> <owlr:argument2 rdf:about="#male" /> </owlr:individualPropertyAtom> </owlr:antecedent> <owlr:consequent rdf:parseType="Collection"> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="⪚hasUncle"/> <owlr:argument1 rdf:about="#_x1" /> <owlr:argument2 rdf:about="#_x3" /> </owlr:individualPropertyAtom> </owlr:consequent> </owlr:Rule>
This example is a repetition of Example 5.1-3 using RDF/XML syntax:
<owlr:Variable rdf:ID="_x"/> <owlr:Variable rdf:ID="_y"/> <owlr:Variable rdf:ID="_z"/> <owlr:Rule> <owlr:antecedent rdf:parseType="Collection"> <owlr:classAtom> <owlr:classPredicate rdf:about="&ulan;Artist"/> <owlr:argument1 rdf:about="#_x" /> </owlr:classAtom> <owlr:classAtom> <owlr:classPredicate rdf:about="&aat;Style"/> <owlr:argument1 rdf:about="#_y" /> </owlr:classAtom> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="&aatulan;artistStyle"/> <owlr:argument1 rdf:about="#_x" /> <owlr:argument2 rdf:about="#_y" /> </owlr:individualPropertyAtom> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="&vra;creator"/> <owlr:argument1 rdf:about="#_x" /> <owlr:argument2 rdf:about="#_z" /> </owlr:individualPropertyAtom> </owlr:antecedent> <owlr:consequent rdf:parseType="Collection"> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="&vra;style/period"/> <owlr:argument1 rdf:about="#_z" /> <owlr:argument2 rdf:about="#_y" /> </owlr:individualPropertyAtom> </owlr:consequent> </owlr:Rule>
This example is a repetition of the complex rule from Example 5.1-4 using RDF/XML syntax:
<owlr:Variable rdf:ID="_airport"/> <owlr:Variable rdf:ID="_loc"/> <owlr:Variable rdf:ID="_name"/> <owlr:Variable rdf:ID="_lat"/> <owlr:Variable rdf:ID="_lon"/> <owlr:Rule> <owlr:antecedent rdf:parseType="Collection"> <owlr:classAtom> <owlr:classPredicate rdf:about="&airport-ont;Airport"/> <owlr:argument1 rdf:about="#_airport" /> </owlr:classAtom> <owlr:individualPropertyAtom> <owlr:propertyPredicate rdf:resource="#location"/> <owlr:argument1 rdf:about="#_airport" /> <owlr:argument2 rdf:about="#_loc" /> </owlr:individualPropertyAtom> <owlr:datavaluedPropertyAtom> <owlr:propertyPredicate rdf:resource="#latitude"/> <owlr:argument1 rdf:about="#_loc" /> <owlr:argument2 rdf:about="#_lat" /> </owlr:datavaluedPropertyAtom> <owlr:datavaluedPropertyAtom> <owlr:propertyPredicate rdf:resource="#longitude"/> <owlr:argument1 rdf:about="#_loc" /> <owlr:argument2 rdf:about="#_lon" /> </owlr:datavaluedPropertyAtom> </owlr:antecedent> <owlr:consequent rdf:parseType="Collection"> <owlr:classAtom> <owlr:classPredicate> <owl:Restriction> <owl:onProperty rdf:resource="#sameLocation"/> <owl:someValuesFrom> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="↦Location"/> <owl:Restriction> <owl:onProperty rdf:resource="↦isLocationOf"/> <owl:someValuesFrom> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="↦Point"/> <owl:Restriction> <owl:onProperty rdf:resource="↦isObjectOf"/> <owl:someValuesFrom> <owl:oneOf rdf:parseType="Collection"> <owl:Item rdf:resource="#layer"/> </owl:oneOf> </owl:someValuesFrom> </owl:Restriction> </owl:intersectionOf rdf:parseType="Collection"> </owl:someValuesFrom> </owl:Restriction> </owl:intersectionOf rdf:parseType="Collection"> </owl:someValuesFrom> </owl:Restriction> </owlr:classPredicate> <owlr:argument1 rdf:about="_airport" /> </owlr:classAtom> </owlr:consequent> </owlr:Rule>