Datalog Characteristics

Datalog Characteristics - Notes

In the above Datalog markup, the three top-level "spent at least" arguments are not further analyzed; they are considered as just individual constants. For identification purposes, they, and the relation itself, would need to be repeated verbatim by a query that is to retrieve the above fact (as illustrated by the query in the if part of the rule below). A step-wise refining analysis could exhibit the internal structure and natural-language meaning of the relation and basic three arguments using further, auxiliary, arguments, or proceeding from Datalog to Hornlog (function-ful) RuleML, with all steps marked up in RuleML.

Notice that in Datalog RuleML a relation can be n-ary (polyadic), i.e. have a variable, but finite, number, n = 0, 1, 2, 3, ..., of arguments. A Datalog restricted to unary (monadic) and binary (dyadic) relations is an important special case, e.g. for combining RuleML with OWL, as in SWRL. While the above markup uses one 3-ary"spent at least" relation, it could also be reduced to three binary relations branching off from an individual constant that stands for the ternary relationship, as suggested by the above RDF-oriented XML visualization and explained in a W3C Working Group Note. However, to preserve the expressiveness of the relational model for databases and SQL as well as of Prolog, Datalog RuleML permits the straight representation of n-ary relations, as visualized with directed hyperarcs in Grailog. Moreover, Datalog RuleML provides for the markup of SQL-style null values via empty individuals, <Ind/>.