Experiences Using Deliberation RuleML 1.01 as Rule Interchange Language Do Rulebases Need an External Vocabulary?
Matthias Tylkowski and Martin M¨uller
Binarypark, Erich-Weinertstr. 1, 03044 Cottbus, Germany
Abstract. After four decades of development, it is now well accepted that rules are one of the most suitable decisioning mechanism for change- intensive applications. Moreover, as web applications are expanding ev- erywhere, rule languages allow to publish, trasmit, deploy, and execute rules on the Web. This paper describes some principles and practices of developing rulebases from computationally independent business models using Deliberation RuleML version 1.01. We present a complete rulebase, based on the UServ Product Derby Case Study, ready to be deployed into rule systems allowing RuleML serialization. We also raise two issues that the next version of Deliberation RuleML may address: i) reference to external domain vocabularies used by rules and ii) distinction be- tween binary object properties, i.e. predicates/relations (whose second argument is a RuleML Ind element), and datatype properties, i.e. pred- icates/relations (whose second argument is a RuleML Data element), as in OWL.
1 Introduction
Rule based applications have a long history starting with the early attempts to make logic an executable language [13], the age of expert system applications [9], the introduction of object orientation [12], and the accommodation of rule-based reasoning into mainstream programming languages [18]. Experiments with rule interchange were pioneered back in 2006-2007 by [10, 14, 16] within a rule interchange framework R2ML, [21, 22]. Inspired by RuleML [5, 8, 20], R2ML provided an approach to integrate the Object Con- straint Language (OCL), the Semantic Web Rule Language (SWRL) and the Rule Markup Language (RuleML). Development of the R2ML language ended in 2008 and after that some progress was made by the W3C RIF activity to achieve a standard for rule interoperability. RuleML continued the development [7] so that by now various families of rule languages are available, including Delibera- tion RuleML [6], Reaction RuleML [17] and Legal RuleML [1, 2]. Towards restarting the debate about rule interoperability, this paper de- scribes a RuleML 1.01 rulebase accommodating the UServ Product Derby Case Study. The UServ study describes rules using natural language, and provides a scenario simulating a vehicle insurance service. The main purpose is to compute an annual premium for a vehicle insurance policy, belonging to an eligible client. Using a business-specific language, UServ divides its business rules into sets, each of them addressing different goals and contexts i.e. calculates the eligibil- ity scores in order to set the eligibility status for a client/driver/car, as well as pricing and cancelation policies at client portfolio level. The goal of this work is to provide a tutorial for practitioners developing business rule applications from natural language descriptions based on core ontological concepts like classes and variables, to target rule systems. UServ was also implemented using R2ML.
2 Mapping the Data Model into Rules
Rules should be based on vocabularies, i.e. the defined universe of discourse. The UServ case identifies classes such as cars, clients, drivers, their subclasses such as ConvertibleCar, YoungDriver and their properties e.g. theftRating, price, age, and so on. We use F-logic [11, 12] as the executable language for UServ rules. We map all universe-of-discourse artefacts according to the mapping rules in- troduced by R2ML. In addition, all vocabulary items (predicates, functions, con- stants) are identified by URIs, e.g. http://userv.org/ontology/price identi- fies the binary predicate price. Throughout this paper we use the RuleML 1.01 NafNegHornlogEq sub-language, where equality is used just because, in general, Deliberation RuleML 1.01 does not allow the direct definition of global constants (more in Section 2.4).
2.1 Mapping Classes
UServ classes are mapped to RuleML types or unary predicates. These are the two significant options to encode such classes – either by using the @type at- tribute or by using an explicit class definition by means of an atom (we assume a declaration of the namespace prefix us: as the iri http://userv.org/ontology/): C
2.2 Mapping subClassOf Relation
The subClassOf relation is not included by RuleML as a language syntacti- cal construct. However, there are solutions to realize it, either by defining the subClassOf relation axiomatically or by binding the rulebase to an external vocabulary defining this relation. Defining subClassOf Axiomatically
Binding a Rulebase to an External Vocabulary
An elegant solution, also discussed in [3] and [10], and implemented in OO jDREW, is to define this relation at the domain vocabulary level using an ap- propriate knowledge representation language, for example, RDF Schema:
High Order Atom Construct
The Atom content model of the Deliberation RuleML 1.01 could be extended to allow high order constructs1, such as:
1 The older RuleML 0.91 was supporting high order constructs via ”Hterm” element.
Declarative Definition of Instances
Finally, because the application domain has a limited number of (car) in- stances, only few of them may be convertible. In this case, from an inference engine perspective, it is less expensive to explicitly define cars and their convert- ibility as facts:
Notice that the above code describes the same individual as being an instance of two types but does not encode any subClassOf relationship between them.
2.3 Mapping Properties
UServ defines object properties and datatype properties. For example, price is a datatype property with a unique value. We map such properties into the traditional first order logic atom:
Also, to express something like ”the car’s potential theft rating is high”, we encode:
2 See http://schema.org and http://lists.w3.org/Archives/Public/public-vocabs/ Such a declaration would allow a rulebase validator to check the consistency of rules, e.g. fail when the below ”multi-priced” atom is encountered:
2.4 Mapping Built-in Predicates and Global Constants
UServ deals with all kinds of conditions such as numerical constraints, e.g. ”price is greater than $45,000”, or list membership conditions ”the car model is on the list of High Theft Probability Auto”. The mapping uses external built-in predicates, specifically the ones introduced by the W3C RIF Datatypes and Built-Ins 1.0.
2.5 Expressing Facts
UServ facts are descriptions of cars such as:
Car 4, 2005 Honda Odyssey, Full Airbags, Alarm System, Price $39,000, Type Luxury Car, Not on "High Theft Probability List" it is obvious to any object oriented modeler that car1 is the id of an object of the type LuxuryCar together with a set of properties (e.g. carModel:’Honda Odyssey’, modelYear:2005). This can be mapped to Deliberation RuleML 1.01 using the traditional logic programming approach:
3 Rules and Rulebases
Deliberation RuleML 1.01 defines rulebases as collections of implications, facts and equations, where the
4 Conclusion and Future Work
This work provides some insight into the Deliberation RuleML 1.01 capabilities to serialize business rule scenarios. We hope that our findings will contribute to improvements in the next RuleML version. We also raise the issue that the next version of Deliberation RuleML may provide: i) reference to external do- main vocabularies used by rules and ii) distinction between binary object proper- ties, i.e. predicates/relations (whose second argument is a RuleML Ind element), and datatype properties, i.e. predicates/relations (whose second argument is a RuleML Data element), as in OWL. Future work will be concerned with a fam- ily of XSLT transformations allowing translation from specific sub-languages of Deliberation RuleML to Prolog and F-logic.
Acknowledgments
We would like to thank to Tara Athan, Harold Boley, Adrian Giurca and Adrian Paschke for their essential feedback and insights that made this work possible.
References
1. Tara Athan, Harold Boley, Guido Governatori, Monica Palmirani, Adrian Paschke, and Adam Wyner. Legalruleml: From metamodel to use cases - (a tutorial). In Leora Morgenstern, Petros S. Stefaneas, Fran¸coisL´evy, Adam Wyner, and Adrian Paschke, editors, RuleML, volume 8035 of Lecture Notes in Computer Science, pages 13–18. Springer, 2013. 2. Tara Athan, Harold Boley, Guido Governatori, Monica Palmirani, Adrian Paschke, and Adam Wyner. Oasis legalruleml. In Enrico Francesconi and Bart Verheij, editors, ICAIL, pages 3–12. ACM, 2013. 3. Harold Boley. Object-oriented ruleml: User-level roles, uri-grounded clauses, and order-sorted terms. In Michael Schroeder and Gerd Wagner, editors, RuleML, volume 2876 of Lecture Notes in Computer Science, pages 1–16. Springer, 2003. 4. Harold Boley. A rif-style semantics for ruleml-integrated positional-slotted, object- applicative rules. In Nick Bassiliades, Guido Governatori, and Adrian Paschke, editors, RuleML Europe, volume 6826 of Lecture Notes in Computer Science, pages 194–211. Springer, 2011. 5. Harold Boley, Mike Dean, Benjamin N. Grosof, Michael Kifer, Said Tabet, and Gerd Wagner. Ruleml position statement. In Rule Languages for Interoperability. W3C, 2005. 6. Harold Boley, Rolf Gr¨utter, Gen Zou, Tara Athan, and Sophia Etzold. A datalog + plus ruleml 1.01 architecture for rule-based data access in ecosystem research. In Antonis Bikakis, Paul Fodor, and Dumitru Roman, editors, RuleML, volume 8620 of Lecture Notes in Computer Science, pages 112–126. Springer, 2014. 7. Harold Boley, Adrian Paschke, and Omair Shafiq. Ruleml 1.0: The overarching specification of web rules. In Mike Dean, John Hall, Antonino Rotolo, and Said Tabet, editors, RuleML, volume 6403 of Lecture Notes in Computer Science, pages 162–178. Springer, 2010. 8. Harold Boley, Said Tabet, and Gerd Wagner. Design rationale for ruleml: A markup language for semantic web rules. In Isabel F. Cruz, Stefan Decker, J´erˆomeEuzenat, and Deborah L. McGuinness, editors, SWWS, pages 381–401, 2001. 9. Randall Davis, Bruce G. Buchanan, and Edward H. Shortliffe. Production rules as a representation for a knowledge-based consultation program. Artif. Intell., 8(1):15–45, 1977. 10. Adrian Giurca and Gerd Wagner. Rule modeling and interchange. In Negru et al. [15], pages 485–491. 11. Michael Kifer. Rules and ontologies in f-logic. In Norbert Eisinger and Jan Maluszynski, editors, Reasoning Web, volume 3564 of Lecture Notes in Computer Science, pages 22–34. Springer, 2005. 12. Michael Kifer and Georg Lausen. F-logic: A higher-order language for reasoning about objects, inheritance, and scheme. In James Clifford, Bruce G. Lindsay, and David Maier, editors, SIGMOD Conference, pages 134–146. ACM Press, 1989. 13. Robert A. Kowalski. Predicate logic as programming language. In IFIP Congress, pages 569–574, 1974. 14. Milan Milanovic, Dragan Gasevic, Adrian Giurca, Gerd Wagner, and Vladan Devedzic. Towards sharing rules between owl/swrl and uml/ocl. ECEASST, 5, 2006. 15. Viorel Negru, Tudor Jebelean, Dana Petcu, and Daniela Zaharie, editors. Proceed- ings of the Ninth International Symposium on Symbolic and Numeric Algorithms for Scientific Computing, SYNASC 2007, Timisoara, Romania, September 26-29, 2007. IEEE Computer Society, 2007. 16. Oana Nicolae, Adrian Giurca, and Gerd Wagner. On interchange between jboss rules and jess. In Costin Badica and Marcin Paprzycki, editors, IDC, volume 78 of Studies in Computational Intelligence, pages 135–144. Springer, 2007. 17. Adrian Paschke, Harold Boley, Zhili Zhao, Kia Teymourian, and Tara Athan. Re- action ruleml 1.0: Standardized semantic reaction rules. In Antonis Bikakis and Adrian Giurca, editors, RuleML, volume 7438 of Lecture Notes in Computer Sci- ence, pages 100–119. Springer, 2012. 18. Mark Proctor. Relational declarative programming with jboss drools. In Negru et al. [15], page 5. 19. Mark Proctor. Drools: A rule engine for complex event processing. In Andy Sch¨urr, D´anielVarr´o,and Gergely Varr´o,editors, AGTIVE, volume 7233 of Lecture Notes in Computer Science, page 2. Springer, 2011. 20. Gerd Wagner, Grigoris Antoniou, Said Tabet, and Harold Boley. The abstract syn- tax of ruleml - towards a general web rule language framework. In Web Intelligence, pages 628–631. IEEE Computer Society, 2004. 21. Gerd Wagner, Carlos Viegas Dam´asio,and Grigoris Antoniou. Towards a general web rule language. Int. J. Web Eng. Technol., 2(2/3):181–206, 2005. 22. Gerd Wagner, Adrian Giurca, and Sergey Lukichev. A general markup frame- work for integrity and derivation rules. In Fran¸coisBry, Fran¸coisFages, Massimo Marchiori, and Hans J¨urgenOhlbach, editors, Principles and Practices of Seman- tic Web Reasoning, volume 05371 of Dagstuhl Seminar Proceedings. Internationales Begegnungs- und Forschungszentrum f¨urInformatik (IBFI), Schloss Dagstuhl, Ger- many, 2005. A UServProductDerbyCaseStudy.ruleml
1 2