The Rule Markup Initiative: RDF Relationships and DTD Modularization Harold Boley Benjamin Grosof Said Tabet Updated (8 Mar 2001) from talk at: RDF Interest Group: Face to face meetingRDF Interest Group: Face to face meeting, Technical Plenary and WG Meeting Event, W3C, Cambridge, Mass., 26/27 Feb 2001
RuleML 1 Structure of the RuleML DTD Hierarchy Our system of DTDs (current version: 0.7) uses a modularization approach similar to XHTML in order to accomodate the various rule subcommunities The evolving hierarchy of RuleML DTDs forms a partial order with ruleml as the greatest element (a ruleml-rooted DAG) -- many ‘smallest’ elements Each DTD node in the hierarchy (conformance “lattice”) corresponds to a specific RuleML sublanguage: – ‘Union’ (join) of sublanguages reached via outgoing links: to smaller or equal nodes below – ‘Intersection’ (meet) of sublanguages via incoming links: from greater or equal nodes above
RuleML 2 The Module Hierarchy of RuleML DTDs urc-bin-data-ground-fact urc-bin-data-ground-log urc-bin-datalog bin-datalogurc-datalog ur-datalog ur-hornlog ur-equalog hornlog equalog datalog ur Rooted DAG will be extended with branches for further sublanguages URL/URI-like ‘ur’-objects ruleml RDF-like triples ur-datalog = join(ur,datalog)
RuleML 3 Initial Example: Backward-Rule Notation may look at you want to review you rule principles Semiformal RuleML markup (still unanalyzed English relation and individual-constant names): conclusion premise
RuleML 4 RuleML Elements of Datalog DTD: Clocksin/Mellish Sample Prolog Clauses Rule (Non-unit clause):Fact (Unit clause): likes Mary wine likes(mary,wine). likes likes( John john, x X ) :- likes likes( x X, wine wine ). Empty ‘and’ true premise factual rule
RuleML 5 RuleML Element of UR-Hornlog DTD: Proposed W3C-Page Authentication Rule may register x person x Tim Berners-Lee (preliminary): Any person (x) may register
RuleML 6 RuleML Element of UR-Hornlog DTD: Proposed W3C-Page Authentication Rule employee in x y last month 2 may register x person x organization y Tim Berners-Lee (preliminary): Any person (x) who was some time in the last 2 months an employee of an organization (y) may register...
RuleML 7 RuleML Element of UR-Hornlog DTD: Proposed W3C-Page Authentication Rule employee in x y last month 2 may register x person x organization y member in y last month 2 Tim Berners-Lee: Any person (x) who was some time in the last 2 months an employee of an organization (y) which was some time in the last 2 months a W3C member may register
RuleML 8 RuleML Elements of UR-Equalog DTD: Equation for URI Expansion uriexp daml uriexp(daml) =
RuleML 9 RuleML Elements of UR-Equalog DTD: Equations for URI Expansion uriexp daml uriexp oil uriexp(daml) = uriexp(oil) = Empty ‘and’ true premise unconditional equation URLs/URIs or URs as 1st-class citizens
RuleML 10 Two-Way Relationship Between RuleML and RDF RDF in RuleML: – RDF triples as facts described by a DTD in the RuleML family – Example: Next slide RuleML in RDF: – RDF graphs and serializations for RuleML rules – To be treated in later slides
RuleML 11 RuleML Element of URC-Bin-Data-Ground-Fact DTD: RDF Triple as Very Special Rule Creator Ora Lassila RDF triple(predicate, subject, object) as atom predicate(subject, object) or rel(ur, ur|ind) " has creator Ora Lassila." (Creator, Ora Lassila)
RuleML 12 From the XML Representation to Possible RDF Representations of RuleML Rules XML: N-ary, positional representation of rules RDF: Binary, labeled representation of rules with nodes for resources and labels as explicit role names Parallel labeled arcs for N-element rulebases and N-ary conjunctions; Operator, Arg1,..., ArgN for relation/function Operator applied to N arguments through atoms/nanos
RuleML 13 XML Representation of Buy Sample Rule: Node-Labeled, Left-to-Right-Ordered Tree atom buypersonmerchant relvar object var atom sellmerchantperson relvar object var if rulebase Different XML nodes (dots, often omitted) can carry the same label Implicit left-to-right and top-down orders could also be made explicit
RuleML 14 RDF Representation of Buy Sample Rule: Directed Arc-Labeled Graph (Instances) if1 Element Conc Prem atom1 atom2 rel1 var1var2var3var4var5var6 rel2 rulebase1 buypersonmerchantobject personmerchantobject sell Operator Arg1 Arg2 Arg3 Operator Arg1 Arg2 Arg3 Name RDF resources (ovals) are nodes (URIs), hence require unique indexes RDF literals (rectangles) are also nodes, hence copies should be identified
RuleML 15 RDF Representation of Buy Sample Rule: Directed Node/Arc-Labeled Graph (Types) if Element Conc Prem atom rel var rel rulebase buypersonmerchantobject personmerchantobject sell Operator Arg1 Arg2 Arg3 Operator Arg1 Arg2 Arg3 Name Same RDF types (ovals) denote different anonymous resources RDF literals (rectangles) likewise viewed as anonymous resources
RuleML 16 The Implemented RDF Representation: RuleML as RDF Serializations & Graphs RDF Container Bag for N-element rulebases and N-ary conjunctions (Set would be more precise); Seq for N-ary argument lists of atoms and nanos Preliminary serialization, open to change (see above): Joint work with DAML-Rules and Triple system, and possibly with Notation 3 and Euler aboveDAML-Rules TripleNotation 3Euler Realized by XSLT translator from valid RuleML rulebases to RDF short (“Description type”) syntax (cf. nested property lists): Visualized by RDFViz tool: Queries and inferences can, e.g., be implemented via Triple and Euler
RuleML 17 <!-- In English: This rule says that a person buys an object from a merchant if the merchant sells the object to the person. --> buy person merchant object sell merchant person object
RuleML 18 buy person merchant object
RuleML 19 sell merchant person object
RuleML 20 Conclusions RuleML DTD 0.7, a system of 12 DTDs, is available at indtd.html ; sample files at indtd.htmlhttp:// The rule represent ation in RDF is described at Further rule categories (e.g. ICs and triggers) and DTD updates will be available via main RuleML page at Distributed KR can already be based on current DTDs -- using (XSLT) transformations to reach follow-up and Participants’ DTDsParticipants’