]]>This is a revised 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).
The current Version 0.8 differs from the earlier Version 0.7 by principally shifting the approach from a positional representation of rules towards an object-centered one. This was motivated by RuleML's semantic neutrality w.r.t. backward and forward reasoning as well as by a comparison of the mostly positional XML data model with the mostly object-centered RDF data model: In Version 0.7, a rule ('if') element's children were positionalized, XML-style, in the fixed order of a conclusion followed by premises; in Version 0.8, a rule ('imp') element's children are predicate-object ('role'-'type') pairs, RDF-style, whose positions are immaterial. Thus, while Version 0.8, as well as future versions, remain based on XML, we make an object-centered usage of XML via novel 'role' tag names complementing the normal 'type' tag names. In order not to change too many things at once, we didn't yet work on proceeding from DTDs to XML Schemas. However, we already see some places where the added expressive power of XML Schemas could help Version 0.8, in particular, XML Schema datatypes. The XML Schema expressiveness should also improve the other important change in RuleML, namely the replacement of Version 0.7 ur elements by corresponding Version 0.8 attributes. This permits not only each ind but also each rel (as required for RDF triples) etc. to be regarded as a URI 'object'. Important additions in RuleML 0.8 are the n-tuple (tup) and role-list (roli) datatypes, which can be employed, respectively, in a positional and non-positional manner, to replace all n-ary operations by unary ones.
The DTD files etc. of the earlier Version 0.7 will be kept "as is"; actually, RuleML 0.7 can be regarded as a language in its own right, which may serve future RuleML versions as a "purely positional" reference language for feature comparisons etc. Since to our knowledge not many rulebases have yet been written in Version 0.7 (with the notable exception of GEDCOM), we currently have no full-blown XSLT translator for automatically upgrading them to Version 0.8. However, there is a GEDCOM-oriented upgrading translator (cf. the GEDCOM entry of the RuleML Rulebase Library), which should be easy to adapt to other RuleML 0.7-to-0.8 upgrades. Version 0.8 was partially inspired by a presentation of RuleML 0.7 to an RDF audience. Hence, a RuleML 0.7-to-RuleML 0.8 translator could probably be constructed taking our experimental RuleML 0.7-to-RDF translator as a starting point. Since RuleML 0.7 is a positional system with similarities to RFML, a 0.7-to-0.8 translator could also take advantage of the translator from RFML to RuleML 0.8.
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 derivation rules, not reaction rules (special tags for facts have now been introduced).
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 as allowed in (equational) Horn logic. We also introduce a URL/URI language corresponding to simple objects. The 'UR'-Datalog join of both of these classes then permits inferences over RDF-like 'resources' and can be re-specialized to RDF triples: hierarchy slide.
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.
Here we exemplify RuleML 0.8 in the context of six versions of rule representations as trees and their corresponding XML markups, from totally ordered (most concise) to totally labeled, with Seq containers (most verbose). The first version corresponds to RuleML 0.7 with if replaced by imp. The last version is the one most related to RDF. The T3/X3 version corresponds to RuleML 0.8, which employs RDF-like role labels exactly where they prevent order overspecification (which arbitrarily puts a non-positional type into the child order) and uses the natural XML child order instead of RDF's Seq containers.
We will use the following sample rule:
<_head>
<_head>
<_head>
<_head>
<_head>
A comparison of these six tree/markup versions shows the following:
However, RuleML 0.8 also provides an n-tuple datatype in its http://www.ruleml.org/0.8/dtd/ruleml-hornlog.dtd. This tup type can be employed to reduce all atoms to binary "_opr"-"_1" element pairs, where the original n arguments after opr become the n elements of a single tup argument under an (implicit) _1 role. Similarly for nanos and cterms. Such a 'tupping' of arguments may be used to confine positional types to n-tuples and other built-ins (e.g., 'and'). The Version T7/X7 below exemplifies.
<_head>
For the above T3/X3 version constituting RuleML 0.8 we now exemplify the abstraction achieved by regarding all commutative possibilities as equivalent. In this 'abstract syntax' commutative tree variants will be graph-theoretically equivalent and the corresponding commutative markup variants will be algebraically equivalent. More precisely, for trees the branching order of the (explicitly labeled) "*" arcs is immaterial and for markups the following equation holds: <element>. . .<_role1>...</_role1>. . .<_role2>...</_role2>. . .</element> = <element>. . .<_role2>...</_role2>. . .<_role1>...</_role1>. . .</element>. Note that such an abstraction is also implicit in RDF graphs and serializations, since both the triples within RDF models and the pairs within rdf:Description can be permuted without information loss. The following examples of the sixteen equivalent 'Commutations' of T3/X3 illustrate, starting with our original T3/X3 version.
<_head>
<_head>
. . .
<_body>
. . .
<_body>
Appended below is a preliminary DTD, designated version 0.8, for a 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.8, at this URL: http://www.ruleml.org/0.8/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, a proper superset of, the one appended below. The one below is called "monolith", because it has stripped out the ENTITY interface declarations that are in the website (non-"monolith") 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 "monolithically", as explained in Appendix 3, using the own.ruleml example of Appendix 2 (the Warnings here concern only stylistic matters).
You may also use the non-"monolith" 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 now use an explicit, abbreviating "fact" tag. Similarly, abbreviating tags will probably be needed for reaction rules and integrity constraints.
User comments on all levels are currently 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.8/exa . See the instructions above (about View | Page Source, etc.) for viewing the content etc.
Should the 'UR' attribute in inds etc. be renamed from (XHTML-like) 'href' to (our favorite) 'uref', 'ur', 'resource', or something else?
More issues are being collected by Said Tabet.
]]>
<_head>
<_opr>own
person
object
<_body>
<_opr>buy
person
merchant
object
<_opr>keep
person
object
<_head>
<_opr>buy
person
merchant
object
<_body>
<_opr>sell
merchant
person
object
<_head>
<_opr>sell
John
Mary
XMLBible
<_head>
<_opr>keep
Mary
XMLBible
]]> Go to]]>
http://www.stg.brown.edu/service/xmlvalid/
Paste in at
URI:
http://www.ruleml.org/0.8/exa/own.ruleml
> Hit the 'Validate' button
> You should get:
Validation Results for http://www.ruleml.org/0.8/exa/own.ruleml
Warnings:
line 39, http://www.ruleml.org/0.8/exa/own.ruleml:
warning (901): deprecated sequence within comment ending at: --
Document validates OK.]]>
Site Contact:
Harold Boley.
Page Version: 2002-03-07
"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)