RuleML DTDs
]]> R u l e M L

RuleML DTDs

Harold Boley, Benjamin Grosof, Said Tabet

Version History, 2001-01-25: Version 0.7

Latest version: www.ruleml.org/spec

All DTDs: DTD Directory

Some Examples: Examples Directory




This is a preliminary DTD draft for RuleML. Each DTD in the evolving hierarchy corresponds to a specific RuleML sublanguage. The DTDs use a modularization approach similar to the one in XHTML in order to offer appropriate flexibility and accomodate different implementations and approaches. We will write a technical report on this system of RuleML DTDs (see also KR Principles and DTD Modularization).

Overview

The upper layer of the RuleML hierarchy of rules is discussed in our main page's design section. In that terminology, the system of RuleML DTDs presented here only covers state-preserving rules (declarative, deductive-rewriting rules), not state-changing rules (active, trigger rules); special tags for facts are also omitted.

This is because we think it is important to start with a subset of simple rules, test and refine our principal strategy using these, and then work 'up' to the more general categories of rules in the hierarchy. For this we choose Datalog, a language corresponding to relational databases (ground facts without complex domains or 'constructors') augmented by views (possibly recursive rules), and work a few steps upwards to further declarative rules from (equational) Horn logic. We also work upwards from a URL/URI language corresponding to simple objects. The join of both of these branches then permits inferences over RDF-like 'resources' and can be re-specialized to RDF triples.

Regarding the concrete markup syntax, we have been experimenting with several DTDs prior to the current, still preliminary, version. The rationale for our current tags is as follows. An explicit N-ary conjunctive tag pair <and> ... </and> is used, preparing other boolean connectives (mainly <or> ... </or>) and their nesting. Using and for the conjunction of premises, rules become binary, in particular our deductive-rewriting implication rules become <if> conc <and> prem1 ... premN </and> </if> The (conclusion and premise) roles of the two subelements (children) of the XML element <if> conc prem </if> thus need no further markup, making it compatible to future equivalence rules <equiv> lequiv requiv </equiv> and consistent to all other RuleML connectives. The backward notation of <if> conc prem </if> does not compromise the directional neutrality of these state-preserving rules, but makes them consistent to the standard notation of Horn rules and to future directed equations.

Explanations

Appended below is a preliminary DTD, designated version 0.7, for the Datalog subset of RuleML (Appendix 1). Also appended below is a simple example rulebase that conforms to that DTD, and instructions for how to validate the example against the DTD.

There now also is a family of DTD's, specified in a modular fashion (using parameter ENTITY declarations), also designated vers. 0.7, at this URL: http://www.ruleml.org/0.7/dtd/ . Note that this family of DTD's is, overall, more raw/immature than just the Datalog member of that family. Note that the Datalog DTD on the website is a bit more complex, but equivalent, to the one appended below. The one below is called "stand-alone", because it has stripped out most of the ENTITY declarations that are in the website (non-"stand-alone") version.

To see the DTD's on the website: After you clicked on the *.dtd files, you may have to select View | Page Source. Thus, we provide additional *.dtd.txt links. Downloading should work anyway.

You can try things out "stand-alone", as explained in Appendix 3, using the own.ruleml example of Appendix 2 (Warnings here concern only stylistic matters).

You may also use the non-"stand-alone" modules to study XML's "INCLUDE"/"IGNORE" overriding method for DTDs that are read in via "ENTITY % ... SYSTEM *.dtd" declarations. But you can get the gist of the definitions also when treating most of these house-keeping directives as no-ops.

After some discussions, we found a set of tag names that sound reasonable to us. Feedback is very welcome.

Facts are currently simply rules ("if" elements) that have empty (i.e. 'true') 'and' prems. We'll need an explicit, abbreviating tag. Similarly, perhaps, for trigger rules and integrity constraints.

User comments on all levels are already taken care of by XML; look at the sample datalog document own.ruleml.

More sample files -- each referring to the most specific DTD still validating them -- can be found at: http://www.ruleml.org/0.7/exa/ . See the instructions above (about View | Page Source, etc.) for viewing the content etc.

Appendix 1: DTD for Datalog subset of RuleML
]]>
Appendix 2: Example RuleML document: a rulebase with filename own.ruleml
own person object buy person merchant object keep person object buy person merchant object sell merchant person object sell John Mary XMLBible keep Mary XMLBible ]]>
Appendix 3: Instructions/Trace on Validating the example against the DTD
Go to]]> http://www.stg.brown.edu/service/xmlvalid/ Paste in at URI: http://www.ruleml.org/0.7/exa/own.ruleml > Hit the 'Validate' button > You should get: Validation Results for http://www.ruleml.org/0.7/exa/own.ruleml Warnings: line 31, http://www.ruleml.org/0.7/dtd/ruleml-datalog-standalone.dtd: warning (652): element has more than one attlist declaration: rulebase line 73, http://www.ruleml.org/0.7/exa/own.ruleml: warning (1106): empty-tag syntax used for element not declared with EMPTY content model: and line 92, http://www.ruleml.org/0.7/exa/own.ruleml: warning (1106): empty-tag syntax used for element not declared with EMPTY content model: and Document validates OK.]]>

Site Contact: Harold Boley. Page Version: 2001-02-14


"Practice what you preach": XML source of this homepage at index.xml (index.xml.txt);
transformed to HTML via the adaptation of Michael Sintek's SliML XSLT stylesheet at homepage.xsl (View | Page Source)