A Framework for Web-based Interoperation among Business Rules Yevgen Biletskiy Department of Electrical and Computer Engineering University of New Brunswick Fredericton, Canada biletski AT unb.ca Abstract—The present paper describes the approach and two Slotted Language (POSL) [3] and Notation 3 (N3) [4]. These technical solutions for interoperation between business rules and other Web-based techniques can be integrated with the represented in various formats. The Semantic Web techniques purpose to find better business solutions based on information are used to enable this interoperation. One of the interoperation stored in different rule bases accessible through Internet. The methods uses the Java Interoperation Object (JIO) described in purpose of the present work is to enable semantic the context of Positional-Slotted Language (POSL), which a interoperability between business rules created in various human-friendly variant of the Rule Markup Language formats. (RuleML), and Notation 3 (N3) representations. Details of the connections between these document representations are demonstrated with the use of query-based interoperation II. THE FRAMEWORK between POSL and N3. Another solution described in the The resented approach to interoperation is based on present paper is conversion of business rules stored in Microsoft semantic interoperability using a mediator, which can convert Excel as decision tables into POSL using OpenL tablets. Although the current business rules interoperation framework business rules among various knowledge representations. The involves three formats (Excel, POSL, and N3), it can be extended software mediator can process and interpret business rules to other document representations through appropriate stored in various formats, as well as convert a query conversions of data in rule bases and queries. formulated in any of these formats to search an answer in all rule bases connected. This will assist clerks, brokers, Keywords— Knowledge Representation, XML, RDF, Notation managers, and other specialists in finding better business 3, Positional-Slotted Language, Rule Markup Language, Semantic solutions and decision-making. Web, Query Since business rules become Web-based, the modern solutions for interoperation can be deployed. The solutions I. INTRODUCTION presented in this work use the Sematic Web infrastructure and Business rules are becoming ubiquitous in modern industry related tools. The Semantic Web offers solutions allowing to and are usually created, stored, and maintained by business semantically enriching business rules using a background analysts, knowledge engineers and software engineers in ontology, which serves as a knowledge base (or vocabulary). various formats. Some formats are technical, and some formats On the other hand, the disadvantage of creating and are non-technical and more user-friendly. Classically, business maintaining business rules in a Semantic Web language is that rules are logic constructs (e.g. “IF-THEN” type), and they are rules are difficult for human understanding. Even POSL, often represented using decision tables or decision trees. which is more human-oriented than RuleML, is difficult for a Technically, business rules can also be implemented using a non-specialist to understand. The focus of the present work is programming language like C or Cobol, or by the use of a query-based interoperation between two Semantic Web based controlled English. There are many specific solutions for languages: POSL and N3, and conversion of business rules in creation and maintenance of business rules. For instance, MS Excel format into POSL. The focused interoperation Microsoft Excel tables can be deployed as a user-friendly way framework is presented in Fig. 1. to build documents representing decision tables. Systems like The framework presented in Fig. 1 consists of the Drools provide excellent platforms to build and maintain more following main components: complex business rules. There are some standards for business 1. POSL rule base, which consists of business rules and facts rules representations. The most known is the Semantics of Business Vocabulary and Business Rules (SBVR) [1] adopted in the POSL format. rule base, which consists of rules and by the Object Management Group (OMG). With the wide facts in the N3 format. proliferation of the Semantic Web techniques, some new 2. MS Excel database, which contains rules and facts in the languages for business rules representation appeared, for user-friendly format. instance, Rule Markup Language (RuleML) [2], Positional- POSL Rule Base Excel-POSL Excel Rule Base Converter OOjDREW JIO POSL Query Parsers Ontology N3 Query Reverse Parsers Euler Conversion Rules N3 Answer POSL Answer N3 Rule Base Figure 1. Focused Business Rules Interoperation Framework 3. JIO (Java Interoperation Object), which The Java Interoperation Object is the basis of interoperation III. JIO, POSL AND N3 methods developed for the Knowledgebase Representation The technical details of JIO (Java Interoperation Object) Interoperation Tool (KRLIT) described technically in [5]. architecture and the use of JIO within the KRLIT are The objective of KLIRT is to facilitate interoperation explained in [5]. The Java Interoperation Object is the basis of among existing knowledge representation paradigms methods for business rules interoperation. The objective of through a universal Java-based architecture, which used this component is to capture as many aspects of the various RuleML as a building block. The current KRLIT has been knowledge representation paradigms available. This concept is successfully developed and used for query-based used to translate supported POSL and N3 rule bases. JIO uses translation between POSL and N3 knowledge bases. atoms to represent chunks in a rule base (e.g. for POSL this is 4. Excel – POSL converter is presented in [6]. POSL can be a relation, for N3 this is a subject). generated from Excel decision tables. Before this, it is POSL provides object-centered instance descriptions via necessary to identify and extract the facts and rules binary properties, taxonomies over classes and properties, contained within the tables. OpenL Tablets [7] provides an class-forming operations and class/property axioms, and API that facilitates simple creation and processing of Java- derivation, integrity, transformation, and reaction rules [3]. based tables in Microsoft Excel. While OpenL itself has a POSL is a more human-readable language than the XML- rule engine capable to process these decision tables, this based RuleML [2], but has the same language constructs. engine does not offer semantic enrichment with a POSL has two representation paradigms which it can use, background ontology and application-independence. As a depending on what the user requires. The first of which is result, OpenL is used solely for its ability to process Excel positional; this means that slots are not used to represent tables and externalize Java code from the application logic. relation contents. The second option is slotted; this means that The OpenL table parser uses templates to extract the property names are associated with every element in a relevant information (data and rules) from the decision relation. The latter best suits our JIO framework, and so this tables into memory, where it can generate semantically paradigm has been chosen. rich POSL. Notation 3 is a compact, rule-extended version of RDF's 5. Reasoning engines: OOjDREW [8] for RuleML/POSL and XML syntax [4]. In this way, RDF’s complex machine Euler for N3. understandable language becomes more readable to humans. 6. Parsers – to syntactically analyze business rules in POSL RDF facts and rules are still written with triples (subject – and N3, and convert them into the JIO format. property - object) and so this language is expressive in nature, 7. Reverse parses – to convert business rules from JIO format but also good for human comprehension. into a format required by the user. In order to deal with any input and fetch the answers from the In the present framework, the user can query the knowledge available Knowledge, the system should re-present this input bases using POSL or N3 formats, and receive the answer in the in order to convert it to intermediate JIO representation same format as query. (RuleML building blocks) which from-and-to the system can be interoperated to the target language. The interoperation :company :MainlandInsurance; :clientID ?ClientID; process using the JIO representation can be done by :age ?Age; implementing Parser and ReverseParser. :class ?b; The main goal of Parser is to take a query or answer of a :discount 0.1.}. query of a language from a File, URL or as a String in the form of InputObjectCollection, and then parses it (breaks down) to Healthy Life focuses on Gold and Platinum-class RuleML building blocks, which will compose a single customers, and prefers to use a POSL knowledge base as AtomCollection as JIO representation in order to provide it to ReverseParser as input. Similarly, ReverseParser takes this follows (policy for providing a discount of 20% to a Gold JIO AtomCollection as input and reverse parses it (translates) to customer who is between the age of 16 and 20): the target language as output with option of returning the result as an answer or query. Details of parser’s implementation are Discount(company->HealthyLife; clientID->?ClientID; age-> ?a:Integer; presented in [5]. class-> ?b;discount-> 0.2:Real) :- client(clientID->?ClientID;age->?a:Integer; name->fullname[ first->?FName; IV. INTEROPERATION BETWEEN POSL AND N3 BUSINESS last->?LName]; class-> ?b), RULES greaterThanOrEqual(?a, 16 : Integer), The present work describes POSL-N3 interoperation using lessThanOrEqual(?a, 20 : Integer), equal(?b, Gold). an example of an insurance company Farm Insurance and two on-line insurance brokers, which are insurance companies Mainland Insurance and Healthy Life. The companies use Suppose the customer is familiar with POSL only, but different knowledge representation languages, but use the wants to find discount policies of both insurance brokers. The same schema for their facts and rules. Assume the Farm query is: Insurance has a business rules set describing automobile insurance Age-Class discounts as follows: Discount(company->?All; clientID->?clientID; age->?age; class-> ?b;discount->?discount). Discount Age From Age To Customer Class Value If business rules interoperation is not enabled, the only Healthy Life database is accessible. During query processing 16 20 Economic 0.0 time, this query is transformed by POSL parser into JIO, and 21 25 Economic 0.1 the N3 reverse parser class accepts the transformed query as 26 30 Economic 0.2 input. This provides the N3 representation of this POSL query 16 20 Gold 0.2 as follows: 21 25 Gold 0.3 ?subject 26 30 Gold 0.4 :type :Discount; 16 20 Platinum 0.5 :company:MainlandInsurance; :clientID ?ClientID; 21 25 Platinum 0.6 :age ?Age; 26 30 Platinum 0.7 :class ?Class; This rule base is not accessible by individual users because it This query in POSL is given to OOjDREW, whose answers is not Web-based, but can be accessed by insurance brokers are returned in POSL. Since now the equivalent N3 query is through some internal communications. available, it can be given to Euler as input, whose answers are Mainland Insurance focuses primarily on Economic- given in N3. The answer is used by N3 parser and stored in class customers, and prefers to use an N3 knowledge base as JIO. It is then sent to the POSL reverse parser to generate the follows (policy for providing a discount of 10% to an POSL representation of the N3 answers. This answer is Economic customer who is between the age of 21 and 25): combined with the OOjDREW answer resulting in the following combined POSL answer: { ?Client :type :client; :clientID ?ClientID; Discount(company->MainlandInsurance; :age ?Age; clientID->1:Real;age->19:Real;class->Economic;discount->0.0:Real). :name [:type :fullname; :first ?FName; :last ?LName]; Discount(company->MainlandInsurance; :class ?b. clientID->6:Real;age->17:Real;class->Economic;discount->0.0:Real). ?Age math:notLessThan 21 . Discount(company->MainlandInsurance; ?Age math:notGreaterThan 25 . clientID->2:Real;age->22:Real;class->Economic;discount->0.1:Real). ?b log:equalTo :Economic. } Discount(company->HealthyLife; => clientID->3:Real;age->19:Real;class->Gold;discount->0.2:Real). {?resultDiscount Discount(company->HealthyLife; :type :Discount; clientID->5:Real;age->30:Real;class->Gold;discount->0.4:Real). Discount(company->HealthyLife; with user friendly formats rather than to use heavily human clientID->4:Real;age->29:Real;class->Platinum;discount->0.7:Real). readable Semantic Web languages. The answer is consistent with the business rules maintained by the Farm Insurance. CONCLUSION AND FUTURE WORK The present paper has described the business rules interoperation framework as a solution to the Web-based V. INTEROPERATION BETWEEN MS EXCEL AND POSL interoperation gap issue. The work has focused on USINESS RULES interoperation between business rules created in two different Assume Healthy Life would like to update its rule base Semantic Web languages. The usage examples have been automatically using data from Excel sheets created by Farm presented. The second focus of the paper is a methodology to Insurance. The business rules below need to be converted partially automate the process of converting human-readable from the user-friendly Excel format into POSL: business rules stored in the form of MS Excel tables to machine-processible POSL, with the goal of combining the Discount ease of use of Excel-based rule tables with the semantically- Age From Age To Customer Class Value rich queries supported by reasoning engines. Although the 16 20 Gold 0.2 work in current state covers Excel, POSL and N3 formats only, it can extend to other business rules representations. 21 25 Gold 0.3 26 30 Gold 0.4 16 20 Platinum 0.5 ACKNOWLEDGMENT 21 25 Platinum 0.6 The present work includes business rules interoperation 26 30 Platinum 0.7 techniques which had been implemented as part of students’ projects conducted at the University of New Brunswick under Using rule transformation templates, the table was supervision of the author. The students were Girish R automatically converted to POSL syntax, parsed, and loaded Ranganathan (Dr. Ranganathan now), J Anthony Brown, into the OO jDREW reasoning engine [8]. Examples POSL Taylor Osmun, and Patrick Thébeau. The main funding sources rules derived from the rules above are: for this work are NSERC Discovery Grant and ACOA AIF. Discount(?a : Integer, ?b : Customer, 0.2 : Real) :-greaterThanOrEqual(?a, 26 : Integer), lessThanOrEqual(?a, 30 : Integer), equal(?b, Economic : Customer). REFERENCES Discount(?a : Integer, ?b : Customer, 0.2 : Real) :- greaterThanOrEqual(?a, 16 : [1] SBVR. Available: http://www.omg.org/spec/SBVR/1.0/ Integer), lessThanOrEqual(?a, 20 : Integer), equal(?b, Gold : Customer). [2] H. Boley, The RuleML Family of Web Rule Languages, Invited Talk. Proc. Fourth Workshop on Principles and Practice of Semantic Web Reasoning, Budva, Montenegro, LNCS 4187, Springer-Verlag (2006) 1- 15. As a test, the following query was issued to OO jDREW: [3] H. Boley, POSL: An Integrated Positional-Slotted Language for Semantic Web Knowledge (2004). Available: http://www.ruleml.org/submission/ruleml-shortation.html. Discount(25 : Integer, Gold : Customer, ?discount : Real). [4] T. Berners-Lee et. al. Notation (N3), A readable RDF Syntax. Available: http://www.w3.org/TeamSubmission/n3/ [5] T. M. Osmun, P. Thébeau, Y. Biletskiy. Knowledgebase Representation The query asks “what is the discount value for a customer Language Interoperation Tool. In Proc RuleML America, LNCS 7018, Springer-Verlag (2011) 58-65. with age 25 and type Gold?” The results of query, issued using [6] Y. Biletskiy, G. R. Ranganathan, J. A. Brown. Representing User- the OO jDREW Top-Down reasoning engine, are as follows: Friendly Business Rules in a Semantic Web-Based Format. ISAST Transactions on Computers and Software Engineering 2(1) (2008) 8-12. [7] OpenL Tablets, Available: http://openl- ?discount = 0.3 of type Real. tablets.sourceforge.net/index.html [8] Ball M., Boley H., Hirtle D., Mei J., and Spencer B. The OO jDREW Reference Implementation of RuleML. In Proc. Rules and Rule Markup The solution presented allows automatically updating the rule Languages for the Semantic Web (RuleML-2005), LNCS 3791, base in POSL using rules created in Excel. A similar solution Springer-Verlag (2005) 218–223. can be developed for N3. This allows business analysts to work [9] Euler. Available: http://eulersharp.sourceforge.net/ .