• Aucun résultat trouvé

Experiences Using Deliberation RuleML 1.01 as Rule Interchange Language

N/A
N/A
Protected

Academic year: 2022

Partager "Experiences Using Deliberation RuleML 1.01 as Rule Interchange Language"

Copied!
26
0
0

Texte intégral

(1)

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

(2)

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/):

<!-- 1. type encoding into the variable occurences -->

<Var type="us:ConvertibleCar">C</Var>

<!-- 2. type explicitly defined as an atom -->

<Atom>

<Rel iri="us:ConvertibleCar">car</Rel>

<Var>C</Var>

</Atom>

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.

(3)

Defining subClassOf Axiomatically

<Forall>

<Var>X</Var>

<Implies>

<Atom>

<Rel iri="us:ConvertibleCar">convertibleCar</Rel>

<Var>X</Var>

</Atom>

<Atom>

<Rel iri="us:Car">car</Rel>

<Var>X</Var>

</Atom>

</Implies>

</Forall>

It is obvious that such an axiom must be added for any pair of classes in the application domain that are subject of in a subClassOf relation. Moreover, as- suming that a translation to an executable language will preserve this axiom in this form, inference will be quite expensive as, usually, the subClassOf verifica- tion is much more of a constraint verification than an inference.

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:

<rdfs:Class rdf:ID="http://userv.org/ontology/ConvertibleCar">

...

<rdfs:subClassOf rdf:resource="http://userv.org/ontology/Car"/>

</rdfs:Class>

Of course, the rulebase must provide a reference to this vocabulary, e.g by using type=”us:ConvertibleCar”, as discussed earlier.

High Order Atom Construct

The Atom content model of the Deliberation RuleML 1.01 could be extended to allow high order constructs

1

, such as:

<Atom>

<Rel iri="rdfs:subClassOf">subClassOf</Rel>

<arg index="1">

<Rel

iri="http://userv.org/ontology/ConvertibleCar"

type="http://www.w3.org/2000/01/rdf-schema#Class">convertibleCar</Rel>

1

The older RuleML 0.91 was supporting high order constructs via ”Hterm” element.

(4)

</arg>

<arg index="2">

<Rel

iri="http://userv.org/ontology/Car"

type="http://www.w3.org/2000/01/rdf-schema#Class">car</Rel>

</arg>

</Atom>

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:

<Assert>

<And>

<Atom>

<Rel iri="http://userv.org/ontology/Car">car</Rel>

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80">car1</Ind>

</Atom>

<Atom>

<Rel iri="http://userv.org/ontology/ConvertibleCar">car</Rel>

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80">car1</Ind>

</Atom>

</And>

</Assert>

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:

<Atom>

<Rel iri="http://userv.org/ontology/price">price</Rel>

<!-- the subject of the property -->

<Var>C</Var>

<!-- the value of the property -->

<Var type="xs:positiveInteger">P</Var>

</Atom>

Also, to express something like ”the car’s potential theft rating is high”, we

encode:

(5)

<Atom>

<Rel iri="http://userv.org/ontology/theftRating">theftRating</Rel>

<Var>C</Var>

<Data>

<!-- @type="us:Rating" -->

<us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue>

<us:ratingVerbalization xml:lang="en">high</us:ratingVerbalization>

</Data>

</Atom>

The structured datatype including an integer (i.e. 4) is more convenient than the plain symbol (i.e., high) as it allows a computer program to better deal with val- ues and their verbalizations. It is worthwhile to mention the Schema.org

2

effort to standardize a large common sense vocabulary for web semantics. Unfortunately, the current version of RuleML does not allow such user-defined datatypes but only pre-defined XML datatypes, e.g.

<Data xsi:type="xs:string">high</Data>

Allowing external datatypes would be an improvement, as common types become more and more adopted by the Web community. However, the current content model of the RuleML <Data> element is xs:any; therefore, above, we were still able to encode the necessary structured data.

The values of multi-valued properties such as airbag are mapped into RuleML lists (using <Plex>):

<Atom>

<Rel iri="http://userv.org/ontology/airbag">airbags</Rel>

<Var>C</Var>

<Plex>

<Data xsi:type="xs:string">driverAirbag</Data>

<Data xsi:type="xs:string">frontPassengerAirbag</Data>

</Plex>

</Atom>

Object-valued properties are mapped following the same principles.

While the ”positional” RuleML used above adopted a logic programming syntax, the above method for defining properties (binary predicates) may not be ideal.

However, ”slotted” RuleML, inspired by F-logic, as in Object-Oriented RuleML [3] and PSOA RuleML [4], could be used instead. Because UServ is built on an object-oriented approach (as are many other real-life applications), properties are binary relations. Therefore, it is obvious that knowledge representation languages that define vocabularies are more suited for defining such properties. Here is an example using OWL:

<owl:DatatypeProperty rdf:ID="price">

<rdf:type rdf:resource="owl:FunctionalProperty"/>

<rdfs:domain rdf:resource="http://userv.org/ontology/Car"/>

<rdfs:range rdf:resource="xs:positiveInteger"/>

</owl:DatatypeProperty>

2

See http://schema.org and http://lists.w3.org/Archives/Public/public-vocabs/

(6)

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:

<Atom>

<Rel iri="http://userv.org/ontology/price">p</Rel>

<Var>C</Var>

<Plex>

<Data xsi:type="xs:positiveInteger">23000</Data>

<Data xsi:type="xs:positiveInteger">23500</Data>

</Plex>

</Atom>

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.

<!-- price is greater than $45,000 -->

<Atom>

<Rel iri="pred:numeric-less-than-or-equal">gt</Rel>

<Var type="xs:positiveInteger">P</Var>

<Data xsi:type="xs:integer">45000</Data>

</Atom>

<!-- the car model is on the list of High Theft Probability Auto -->

<Atom>

<Rel iri="prolog:member">member</Rel>

<Var>M</Var>

<Ind type="rdf:Bag">HighTheftProbabilityAutoList</Ind>

</Atom>

Unlike logic programming, object oriented applications deal with global con- stants that are available to all objects. Similarly such a construct will greatly improve rulebase readability.

Deliberation RuleML cannot directly represent global constants but uses equality to explicitly define a collection as an individual such as the above-used HighTheftProbabilityAutoList, e.g.

<Equal oriented="yes">

<Ind>HighTheftProbabilityAutoList</Ind>

<Plex>

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80">car1</Ind>

<Ind iri="http://userv.org/ontology/i/5bff7cc6-72f7-4be3">car3</Ind>

<Ind iri="http://userv.org/ontology/i/5eb91389-f1f3-473c">car5</Ind>

<Ind iri="http://userv.org/ontology/i/3c308aa3-3507-40fa">car6</Ind>

</Plex>

</Equal>

(7)

However, such an approach requires the use of a hornlogeg RuleML language (”eq” referring to equality), while there may be applications which do not really require full equality but only the fragment needed for defining global constants.

However, from the perspective of interoperability, it may be the responsibility of a translator to identify such constructs and translate them into global constants, while still keeping the rest of the rule translation in the realm of a hornlog RuleMl language.

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:

<Assert>

<Atom>

<Rel iri="http://userv.org/ontology/carModel"></Rel>

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80"

type="us:LuxuryCar">car4</Ind>

<Data xsi:type="xs:string">Honda Odyssey</Data>

</Atom>

<Atom>

<Rel iri="http://userv.org/ontology/price"></Rel>

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80"

type="us:LuxuryCar">car4</Ind>

<Data xsi:type="xs:positiveInteger">39000</Data>

</Atom>

<Atom>

<Rel iri="http://userv.org/ontology/hasAlarm"></Rel>

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80"

type="us:LuxuryCar">car4</Ind>

</Atom>

<Atom>

<Rel iri="http://userv.org/ontology/airbags"></Rel>

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80"

type="us:LuxuryCar">car4</Ind>

<Plex>

<Data xsi:type="xs:string">driverAirbag</Data>

<Data xsi:type="xs:string">frontPassengerAirbag</Data>

(8)

<Data xsi:type="xs:string">sideAirbag</Data>

</Plex>

</Atom>

</Assert>

We shall observe that the representation of ”Not on High Theft Probability List”

corresponds to negation as failure (no positive fact). In addition, the global constant HighTheftProbabilityAutoList does not contain this car among its values. This solution has the advantage of preserving the logic programming approach, allowing a translator to still use the NafNegHornlog sub-language.

There are object-oriented rule languages, notably F-logic, Drools [19], and PSOA RuleML allowing declarative descriptions of objects e.g.,

car4:LuxuryCar [ price -> 39000;

modelYear -> 2005;

hasAlarm-> true;

airbags -> [’driverAirbag’,’frontPassengerAirbag’, ’sideAirbag’]

].

Deliberation RuleML could achieve such a representation as in Object-Oriented RuleML or by extending the slotted notation to allow relations as slot names:

<Assert>

<Equal oriented="yes">

<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80">car4</Ind>

<Plex>

<slot>

<Rel iri="http://userv.org/ontology/price"></Rel>

<Data xsi:type="xs:positiveInteger">39000</Data>

</slot>

<slot>

<Rel iri="http://userv.org/ontology/hasAlarm"></Rel>

<Data xsi:type="xs:boolean">true</Data>

</slot>

...

</Plex>

</Equal>

</Assert>

3 Rules and Rulebases

Deliberation RuleML 1.01 defines rulebases as collections of implications, facts and equations, where the <Rule> element is specialized to an <Implies>

<Rulebase xml:id="theftRating">

<!-- Processing car’s theftRating -->

<meta>

<Atom>

(9)

<Rel iri="http://userv.org/ontology/theftRating">theftRating</Rel>

</Atom>

</meta>

<!-- If the car is a convertible, then the car’s potential theft rating is high. -->

<Forall>

<Var type="us:ConvertibleCar">C</Var>

<Atom>

<Rel iri="http://userv.org/ontology/theftRating">theftRating</Rel>

<Var type="us:ConvertibleCar">C</Var>

<Data>

<!-- @type="us:Rating" -->

<us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue>

<us:ratingVerbalization xml:lang="en">high</us:ratingVerbalization>

</Data>

</Atom>

</Forall>

<!--

If the car’s price is greater than $45,000, then the car’s potential theft rating is high.

-->

<Forall>

<Var type="us:Car">C</Var>

<Implies direction="backward">

<And>

<Atom>

<Rel iri="http://userv.org/ontology/price">price</Rel>

<Var>C</Var>

<Var type="xs:positiveInteger">P</Var>

</Atom>

<Atom>

<Rel iri="pred:numeric-greater-than">gt</Rel>

<Var type="xs:positiveInteger">P</Var>

<Data xsi:type="xs:integer">45000</Data>

</Atom>

</And>

<Atom>

<Rel iri="http://userv.org/ontology/theftRating">theftRating</Rel>

<Var>C</Var>

<Data>

<!-- @type = "us:Rating"-->

<us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue>

<us:ratingVerbalization xml:lang="en">high</us:ratingVerbalization>

</Data>

</Atom>

</Implies>

</Forall>

<!-- other rules ... -->

</Rulebase>

(10)

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¸ cois L´ 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.

(11)

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ˆ ome Euzenat, 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´ aniel Varr´ 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¸ cois Bry, Fran¸ cois Fages, Massimo

Marchiori, and Hans J¨ urgen Ohlbach, editors, Principles and Practices of Seman-

tic Web Reasoning, volume 05371 of Dagstuhl Seminar Proceedings. Internationales

Begegnungs- und Forschungszentrum f¨ ur Informatik (IBFI), Schloss Dagstuhl, Ger-

many, 2005.

(12)

A UServProductDerbyCaseStudy.ruleml

1 <?xml version="1.0" encoding="UTF-8"?>

2 <RuleML xmlns="http://ruleml.org/spec" xmlns:us="http://userv.org/ontology/"

3 xmlns:pred="http://www.w3.org/2007/rif-builtin-predicate#"

4 xmlns:prolog="http://prolog-language.org/predicates#"

5 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

6 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

7 xmlns:xs="http://www.w3.org/2001/XMLSchema"

8 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

9 xsi:schemaLocation="http://ruleml.org/spec

10 http://deliberation.ruleml.org/1.01/xsd/nafneghornlogeq.xsd">

11

12 <!-- Axioms -->

13 <Assert>

14 <!--

15 definition of the global constant HighTheftProbabilityAutoList as a list of individuals

16 -->

17 <Equal>

18 <Ind>HighTheftProbabilityAutoList</Ind>

19 <Plex>

20 <Ind>car1</Ind>

21 <Ind>car3</Ind>

22 <Ind>car5</Ind>

23 <Ind>car6</Ind>

24 </Plex>

25 </Equal>

26

27 <!-- subclassOf relationships -that could be defined by an external data model -->

28 <!-- any driver is a person -->

29 <Forall>

30 <Var>X</Var>

31 <Implies>

32 <Atom>

33 <Reliri="http://userv.org/ontology/Driver">driver</Rel>

34 <Var>X</Var>

35 </Atom>

36

37 <Atom>

38 <Reliri="http://userv.org/ontology/Person">person</Rel>

39 <Var>X</Var>

40 </Atom>

41 </Implies>

42 </Forall>

43

44 <!-- any young driver is a driver -->

45 <Forall>

46 <Var>X</Var>

47 <Implies>

48 <Atom>

49 <Reliri="http://userv.org/ontology/YoungDriver">youngDriver</Rel>

50 <Var>X</Var>

51 </Atom>

52

53 <Atom>

54 <Reliri="http://userv.org/ontology/Driver">driver</Rel>

55 <Var>X</Var>

56 </Atom>

57 </Implies>

58 </Forall>

59

60 <!-- any senior driver is a driver -->

61 <Forall>

62 <Var>X</Var>

63 <Implies>

64 <Atom>

65 <Reliri="http://userv.org/ontology/SeniorDriver">seniorDriver</Rel>

(13)

66 <Var>X</Var>

67 </Atom>

68

69 <Atom>

70 <Reliri="http://userv.org/ontology/Driver">driver</Rel>

71 <Var>X</Var>

72 </Atom>

73 </Implies>

74 </Forall>

75

76 <!-- any senior driver is not a young driver -->

77 <Forall>

78 <Var>X</Var>

79 <Implies>

80 <Atom>

81 <Reliri="http://userv.org/ontology/SeniorDriver">seniorDriver</Rel>

82 <Var>X</Var>

83 </Atom>

84 <Neg>

85 <Atom>

86 <Reliri="http://userv.org/ontology/YoungDriver">youngDriver</Rel>

87 <Var>X</Var>

88 </Atom>

89 </Neg>

90 </Implies>

91 </Forall>

92

93 <!-- any young driver is not a senior driver -->

94 <Forall>

95 <Var>X</Var>

96 <Implies>

97 <Atom>

98 <Reliri="http://userv.org/ontology/YoungDriver">youngDriver</Rel>

99 <Var>X</Var>

100 </Atom>

101 <Neg>

102 <Atom>

103 <Reliri="http://userv.org/ontology/SeniorDriver">seniorDriver</Rel>

104 <Var>X</Var>

105 </Atom>

106 </Neg>

107 </Implies>

108 </Forall>

109 </Assert>

110

111 <!-- facts -->

112 <Assert>

113 <Rulebase>

114 <Atom>

115 <Reliri="http://userv.org/ontology/carModel"/>

116 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba"

117 type="http://userv.org/ontology/LuxuryCar">car4</Ind>

118 <Data xsi:type="xs:string">Honda Odyssey</Data>

119 </Atom>

120 <Atom>

121 <Reliri="http://userv.org/ontology/price">price</Rel>

122 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba"

123 type="http://userv.org/ontology/LuxuryCar">car4</Ind>

124 <Data xsi:type="xs:positiveInteger">39000</Data>

125 </Atom>

126 <Atom>

127 <Reliri="http://userv.org/ontology/hasAlarm"/>

128 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba"

129 type="http://userv.org/ontology/LuxuryCar">car4</Ind>

130 </Atom>

131 <Atom>

132 <Reliri="http://userv.org/ontology/airbags"/>

133 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba"

(14)

134 type="http://userv.org/ontology/LuxuryCar">car4</Ind>

135 <Plex>

136 <Data xsi:type="xs:string">driverAirbag</Data>

137 <Data xsi:type="xs:string">frontPassengerAirbag</Data>

138 <Data xsi:type="xs:string">sideAirbag</Data>

139 </Plex>

140 </Atom>

141 </Rulebase>

142

143 <Rulebase>

144 <Atom>

145 <Reliri="http://userv.org/ontology/gender"/>

146 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15bb"

147 type="http://userv.org/ontology/Person">Sara</Ind>

148 <Data xsi:type="xs:string">female</Data>

149 </Atom>

150

151 <Atom>

152 <Reliri="http://userv.org/ontology/age"/>

153 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15bb"

154 type="http://userv.org/ontology/Person">Sara</Ind>

155 <Data xsi:type="xs:positiveInteger">38</Data>

156 </Atom>

157

158 <Atom>

159 <Reliri="http://userv.org/ontology/isMarried"/>

160 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15bb"

161 type="http://userv.org/ontology/Person">Sara</Ind>

162 </Atom>

163

164 <Atom>

165 <Reliri="http://userv.org/ontology/placeOfLiving"/>

166 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15bb"

167 type="http://userv.org/ontology/Person">Sara</Ind>

168 <Data xsi:type="xs:string">Arizona</Data>

169 </Atom>

170

171 <Atom>

172 <Reliri="http://userv.org/ontology/noOfAccidents"/>

173 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15bb"

174 type="http://userv.org/ontology/Driver">Sara</Ind>

175 <Data xsi:type="xs:integer">0</Data>

176 </Atom>

177

178 <Atom>

179 <Reliri="http://userv.org/ontology/noOfMovingViolations"/>

180 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15bb"

181 type="http://userv.org/ontology/Driver">Sara</Ind>

182 <Data xsi:type="xs:integer">1</Data>

183 </Atom>

184

185 <Atom>

186 <Reliri="http://userv.org/ontology/noOfDUI"/>

187 <Indiri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15bb"

188 type="http://userv.org/ontology/Driver">Sara</Ind>

189 <Data xsi:type="xs:integer">0</Data>

190 </Atom>

191 </Rulebase>

192 </Assert>

193

194 <!-- Rulebases-->

195 <Assert>

196 <Rulebase xml:id="theftRating">

197 <!-- Processing car’s theftRating -->

198 <meta>

199 <Atom>

200 <Reliri="http://userv.org/ontology/theftRating">theftRating</Rel>

201 </Atom>

(15)

202 </meta>

203

204 <!-- If the car is a convertible, then the cars potential theft rating is high. -->

205 <Forall>

206 <Vartype="http://userv.org/ontology/ConvertibleCar">C</Var>

207 <Impliesdirection="backward">

208 <if>

209 <Atom>

210 <Reliri="http://userv.org/ontology/convertibleCar">convertibleCar</Rel>

211 <Var>C</Var>

212 </Atom>

213 </if>

214 <then>

215 <Atom>

216 <Reliri="http://userv.org/ontology/theftRating">theftRating</Rel>

217 <Vartype="http://userv.org/ontology/ConvertibleCar">C</Var>

218 <Data>

219 <!-- <Data type = "us:Rating"> -->

220 <us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue>

221 <us:ratingVerbalization xml:lang="en">high</us:ratingVerbalization>

222 </Data>

223 </Atom>

224 </then>

225 </Implies>

226 </Forall>

227

228 <!--

229 If the cars price is greater than $45,000,

230 then the cars potential theft rating is high.

231 -->

232 <Forall>

233 <Vartype="http://userv.org/ontology/Car">C</Var>

234 <Impliesdirection="backward">

235 <And>

236 <Atom>

237 <Reliri="http://userv.org/ontology/price">price</Rel>

238 <Var>C</Var>

239 <Vartype="xs:positiveInteger">P</Var>

240 </Atom>

241 <Atom>

242 <Reliri="pred:numeric-greater-than">gt</Rel>

243 <Vartype="xs:positiveInteger">P</Var>

244 <Data xsi:type="xs:integer">45000</Data>

245 </Atom>

246 </And>

247 <Atom>

248 <Reliri="http://userv.org/ontology/theftRating">theftRating</Rel>

249 <Var>C</Var>

250 <Data>

251 <!-- @type = "us:Rating"-->

252 <us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue>

253 <us:ratingVerbalization xml:lang="en">high</us:ratingVerbalization>

254 </Data>

255 </Atom>

256 </Implies>

257 </Forall>

258

259 <!--

260 If the car model is on the list of High Theft Probability Auto, then the cars potential

261 theft rating is high.

262 -->

263 <Forall>

264 <Vartype="http://userv.org/ontology/Car">C</Var>

265 <Impliesdirection="backward">

266 <And>

267 <Atom>

268 <Reliri="http://userv.org/ontology/carModel">carModel</Rel>

269 <Var>C</Var>

(16)

270 <Vartype="xs:string">M</Var>

271 </Atom>

272 <Atom>

273 <Reliri="prolog:member">member</Rel>

274 <Vartype="xs:string">M</Var>

275 <Indtype="rdf:Bag">HighTheftProbabilityAutoList</Ind>

276 </Atom>

277 </And>

278 <Atom>

279 <Reliri="http://userv.org/ontology/theftRating">theftRating</Rel>

280 <Vartype="http://userv.org/ontology/Car">C</Var>

281 <Data>

282 <!-- @type = "us:Rating"-->

283 <us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue>

284 </Data>

285 </Atom>

286 </Implies>

287 </Forall>

288

289 <!--

290 If all of the following are true, then the cars potential theft rating is moderate.

291 - cars price is between $20,000 and $45,000,

292 - car model is not on the list of High Theft Probability Auto

293 -->

294 <Forall>

295 <Vartype="http://userv.org/ontology/Car">C</Var>

296 <Impliesdirection="backward">

297 <if>

298 <And>

299 <Atom>

300 <Reliri="http://userv.org/ontology/price">price</Rel>

301 <Var>C</Var>

302 <Vartype="xs:positiveInteger">P</Var>

303 </Atom>

304 <Atom>

305 <Reliri="pred:numeric-greater-than-or-equal">ge</Rel>

306 <Vartype="xs:positiveInteger">P</Var>

307 <Data xsi:type="xs:integer">25000</Data>

308 </Atom>

309 <Atom>

310 <Reliri="pred:numeric-less-than-or-equal">le</Rel>

311 <Vartype="xs:positiveInteger">P</Var>

312 <Data xsi:type="xs:integer">45000</Data>

313 </Atom>

314 <Atom>

315 <Reliri="http://userv.org/ontology/carModel">carModel</Rel>

316 <Vartype="http://userv.org/ontology/Car">C</Var>

317 <Vartype="xs:string">M</Var>

318 </Atom>

319 <Naf>

320 <Atom>

321 <Reliri="prolog:member">member</Rel>

322 <Vartype="xs:string">M</Var>

323 <Indtype="rdf:Bag">HighTheftProbabilityAutoList</Ind>

324 </Atom>

325 </Naf>

326 </And>

327 </if>

328 <then>

329 <Atom>

330 <Reliri="http://userv.org/ontology/theftRating">theftRating</Rel>

331 <Vartype="http://userv.org/ontology/Car">C</Var>

332 <Data>

333 <!-- @type = "us:Rating"-->

334 <us:ratingValue xsi:type="xs:positiveInteger">3</us:ratingValue>

335 <us:ratingVerbalization xml:lang="en">moderate</us:ratingVerbalization>

336 </Data>

337 </Atom>

(17)

338 </then>

339 </Implies>

340 </Forall>

341

342 <!--

343 If all of the following are true, then the cars potential theft rating is low:

344 - cars price is less that $20,000

345 - car model is not on the list of High Theft Probability Auto

346 -->

347 <Forall>

348 <Vartype="http://userv.org/ontology/Car">C</Var>

349 <Impliesdirection="backward">

350 <if>

351 <And>

352 <Atom>

353 <Reliri="http://userv.org/ontology/price">price</Rel>

354 <Var>C</Var>

355 <Vartype="xs:positiveInteger">P</Var>

356 </Atom>

357

358 <Atom>

359 <Reliri="http://userv.org/ontology/carModel">carModel</Rel>

360 <Vartype="http://userv.org/ontology/Car">C</Var>

361 <Vartype="xs:string">M</Var>

362 </Atom>

363

364 <Atom>

365 <Reliri="pred:numeric-less-than">lt</Rel>

366 <Vartype="xs:positiveInteger">P</Var>

367 <Data xsi:type="xs:integer">25000</Data>

368 </Atom>

369

370 <Naf>

371 <Atom>

372 <Reliri="">member</Rel>

373 <Vartype="xs:string">M</Var>

374 <Indtype="rdf:Bag">HighTheftProbabilityAutoList</Ind>

375 </Atom>

376 </Naf>

377 </And>

378 </if>

379 <then>

380 <Atom>

381 <Reliri="http://userv.org/ontology/theftRating">theftRating</Rel>

382 <Vartype="http://userv.org/ontology/Car">C</Var>

383 <Data>

384 <!-- @type = "us:Rating"-->

385 <us:ratingValue xsi:type="xs:positiveInteger">1</us:ratingValue>

386 <us:ratingVerbalization xml:lang="en">low</us:ratingVerbalization>

387 </Data>

388 </Atom>

389 </then>

390 </Implies>

391 </Forall>

392 </Rulebase>

393

394 <Rulebase xml:id="injuryRating">

395 <meta>

396 <Atom>

397 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

398 </Atom>

399 </meta>

400

401 <!--

402 If the car has no airbags, then the cars potential occupant injury

403 rating is extremely high.

404 -->

405 <Forall>

(18)

406 <Vartype="http://userv.org/ontology/Car">C</Var>

407 <Impliesdirection="backward">

408 <Atom>

409 <Reliri="http://userv.org/ontology/airbag">airbags</Rel>

410 <Var>C</Var>

411 <Data>

412 <!-- @type = rdf:Bag -->

413 </Data>

414 </Atom>

415 <Atom>

416 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

417 <Var>C</Var>

418 <Data>

419 <us:value xsi:type="xs:positiveInteger">5</us:value>

420 <us:verbalization xml:lang="en">extremely high</us:verbalization>

421 </Data>

422 </Atom>

423 </Implies>

424 </Forall>

425

426 <!--

427 If the car is a convertible and has no roll bar, then the potential occupant injury is

428 extremely high.

429 -->

430 <Forall>

431 <Vartype="http://userv.org/ontology/ConvertibleCar">C</Var>

432 <Impliesdirection="backward">

433 <Naf>

434 <Atom>

435 <Reliri="http://userv.org/ontology/hasRollBar">hasRollBar</Rel>

436 <Vartype="http://userv.org/ontology/ConvertibleCar">C</Var>

437 </Atom>

438 </Naf>

439 <Atom>

440 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

441 <Var>C</Var>

442 <Data>

443 <us:value xsi:type="xs:positiveInteger">5</us:value>

444 <us:verbalization xml:lang="en">extremely high</us:verbalization>

445 </Data>

446 </Atom>

447 </Implies>

448 </Forall>

449

450 <!--

451 If the car only has drivers air bag, then the cars potential occupant

452 injury rating is high.

453 -->

454 <Forall>

455 <Vartype="http://userv.org/ontology/Car">C</Var>

456 <Impliesdirection="backward">

457 <Atom>

458 <Reliri="http://userv.org/ontology/airbag">airbags</Rel>

459 <Var>C</Var>

460 <Plex>

461 <Data xsi:type="xs:string">driver</Data>

462 </Plex>

463 </Atom>

464 <Atom>

465 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

466 <Var>C</Var>

467 <Data>

468 <us:value xsi:type="xs:positiveInteger">4</us:value>

469 <us:verbalization xml:lang="en">high</us:verbalization>

470 </Data>

471 </Atom>

472 </Implies>

473 </Forall>

(19)

474

475 <!--

476 If the car has drivers and front passenger air bags, then the cars potential occupant

477 injury rating is moderate.

478 -->

479 <Forall>

480 <Vartype="http://userv.org/ontology/Car">C</Var>

481 <Impliesdirection="backward">

482 <Atom>

483 <Reliri="http://userv.org/ontology/airbag">airbags</Rel>

484 <Var>C</Var>

485 <Plex>

486 <Data xsi:type="xs:string">driver</Data>

487 <Data xsi:type="xs:string">frontPassenger</Data>

488 </Plex>

489 </Atom>

490 <Atom>

491 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

492 <Var>C</Var>

493 <Data>

494 <us:value xsi:type="xs:positiveInteger">3</us:value>

495 <us:verbalization xml:lang="en">moderate</us:verbalization>

496 </Data>

497 </Atom>

498 </Implies>

499 </Forall>

500

501 <!--

502 If the car has drivers front passenger and side panel air bags, then the cars potential

503 occupant injury is low.

504 -->

505 <Forall>

506 <Vartype="http://userv.org/ontology/Car">C</Var>

507 <Impliesdirection="backward">

508 <Atom>

509 <Reliri="http://userv.org/ontology/airbag">airbags</Rel>

510 <Var>C</Var>

511 <Plex>

512 <Data xsi:type="xs:string">driver</Data>

513 <Data xsi:type="xs:string">frontPassenger</Data>

514 <Data xsi:type="xs:string">sidePanel</Data>

515 </Plex>

516 </Atom>

517 <Atom>

518 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

519 <Var>C</Var>

520 <Data>

521 <us:value xsi:type="xs:positiveInteger">1</us:value>

522 <us:verbalization xml:lang="en">low</us:verbalization>

523 </Data>

524 </Atom>

525 </Implies>

526 </Forall>

527 </Rulebase>

528 </Assert>

529

530 <Assert>

531 <Rulebase>

532 <meta>

533 <Atom>

534 <Reliri="http://userv.org/ontology/autoEligibility">eligibility</Rel>

535 </Atom>

536 </meta>

537

538 <!--

539 If the Potential Occupant Injury Rating is extremely high, then the auto

540 eligibility is not eligible"

541 -->

(20)

542 <Forall>

543 <Vartype="http://userv.org/ontology/Car">C</Var>

544 <Impliesdirection="backward">

545 <Atom>

546 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

547 <Var>C</Var>

548 <Data>

549 <us:value xsi:type="xs:positiveInteger">5</us:value>

550 </Data>

551 </Atom>

552 <Atom>

553 <Reliri="http://userv.org/ontology/autoEligibility">eligibility</Rel>

554 <Var>C</Var>

555 <Data>

556 <us:eligibilityValue>0</us:eligibilityValue>

557 <us:eligibilityVerbalization xml:lang="en">not eligible</us:eligibilityVerbalization>

558 </Data>

559 </Atom>

560 </Implies>

561 </Forall>

562

563 <!--

564 If the Potential Occupant Injury Rating is high, then the auto eligibility is provisional.

565 -->

566 <Forall>

567 <Vartype="http://userv.org/ontology/Car">C</Var>

568 <Impliesdirection="backward">

569 <Atom>

570 <Reliri="http://userv.org/ontology/injuryRating">injuryRating</Rel>

571 <Var>C</Var>

572 <Data>

573 <us:value xsi:type="xs:positiveInteger">4</us:value>

574 </Data>

575 </Atom>

576 <Atom>

577 <Reliri="http://userv.org/ontology/autoEligibility">eligibility</Rel>

578 <Var>C</Var>

579 <Data>

580 <us:eligibilityValue>1</us:eligibilityValue>

581 <us:eligibilityVerbalization xml:lang="en">provisional</us:eligibilityVerbalization>

582 </Data>

583 </Atom>

584 </Implies>

585 </Forall>

586

587 <!-- If the Potential Theft Rating is high, then the auto eligibility is provisional. -->

588 <Forall>

589 <Vartype="http://userv.org/ontology/Car">C</Var>

590 <Impliesdirection="backward">

591 <Atom>

592 <Reliri="http://userv.org/ontology/theftRating">theftRating</Rel>

593 <Vartype="http://userv.org/ontology/Car">C</Var>

594 <Data>

595 <!-- @type = "us:Rating"-->

596 <us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue>

597 </Data>

598 </Atom>

599 <Atom>

600 <Reliri="http://userv.org/ontology/autoEligibility">eligibility</Rel>

601 <Var>C</Var>

602 <Data>

603 <us:eligibilityValue>1</us:eligibilityValue>

604 <us:eligibilityVerbalization xml:lang="en">provisional</us:eligibilityVerbalization>

605 </Data>

606 </Atom>

607 </Implies>

608 </Forall>

609

(21)

610

611 <!--

612 If none of the following is true, then the auto eligibility is eligible

613 - Auto eligibility is not eligible

614 - Auto eligibility is provisional

615 -->

616 <Forall>

617 <Vartype="http://userv.org/ontology/Car">C</Var>

618 <Impliesdirection="backward">

619 <And>

620 <Naf>

621 <Atom>

622 <Reliri="http://userv.org/ontology/autoEligibility">eligibility</Rel>

623 <Var>C</Var>

624 <Data>

625 <us:eligibilityValue>0</us:eligibilityValue>

626 </Data>

627 </Atom>

628 </Naf>

629 <Naf>

630 <Atom>

631 <Reliri="http://userv.org/ontology/autoEligibility">eligibility</Rel>

632 <Var>C</Var>

633 <Data>

634 <us:eligibilityValue>1</us:eligibilityValue>

635 </Data>

636 </Atom>

637 </Naf>

638 </And>

639 <Atom>

640 <Reliri="http://userv.org/ontology/autoEligibility">eligibility</Rel>

641 <Var>C</Var>

642 <Data>

643 <us:eligibilityValue>2</us:eligibilityValue>

644 <us:eligibilityVerbalization xml:lang="en">eligible</us:eligibilityVerbalization>

645 </Data>

646 </Atom>

647 </Implies>

648 </Forall>

649 </Rulebase>

650 </Assert>

651

652 <Assert>

653 <Rulebase>

654 <meta>

655 <Atom>

656 <Reliri="http://userv.org/ontology/YoungDriver">youngDriver</Rel>

657 </Atom>

658 </meta>

659

660 <!-- If the driver is male and is under the age of 25, then young driver. -->

661 <Forall>

662 <Vartype="http://userv.org/ontology/Driver">D</Var>

663 <Impliesdirection="backward">

664 <And>

665 <Atom>

666 <Reliri="http://userv.org/ontology/gender">male</Rel>

667 <Vartype="http://userv.org/ontology/Driver">D</Var>

668 <Data xsi:type="xs:string">male</Data>

669 </Atom>

670 <Atom>

671 <Reliri="http://userv.org/ontology/age">age</Rel>

672 <Vartype="http://userv.org/ontology/Driver">D</Var>

673 <Var>A</Var>

674 </Atom>

675 <Atom>

676 <Reliri="pred:numeric-less-than">lt</Rel>

677 <Vartype="xs:positiveInteger">A</Var>

(22)

678 <Data xsi:type="xs:integer">25</Data>

679 </Atom>

680 </And>

681 <Atom>

682 <Reliri="http://userv.org/ontology/YoungDriver">youngDriver</Rel>

683 <Var>D</Var>

684 </Atom>

685 </Implies>

686 </Forall>

687

688 <Forall>

689 <Vartype="http://userv.org/ontology/Driver">D</Var>

690 <Impliesdirection="backward">

691 <And>

692 <Atom>

693 <Reliri="http://userv.org/ontology/gender">female</Rel>

694 <Vartype="http://userv.org/ontology/Driver">D</Var>

695 <Data xsi:type="xs:string">female</Data>

696 </Atom>

697 <Atom>

698 <Reliri="http://userv.org/ontology/age">age</Rel>

699 <Vartype="http://userv.org/ontology/Driver">D</Var>

700 <Var>A</Var>

701 </Atom>

702 <Atom>

703 <Reliri="pred:numeric-less-than">lt</Rel>

704 <Vartype="xs:positiveInteger">A</Var>

705 <Data xsi:type="xs:integer">20</Data>

706 </Atom>

707 </And>

708

709 <Atom>

710 <Reliri="http://userv.org/ontology/YoungDriver">youngDriver</Rel>

711 <Var>D</Var>

712 </Atom>

713 </Implies>

714 </Forall>

715 </Rulebase>

716 </Assert>

717

718 <Assert>

719 <Rulebase>

720 <meta>

721 <Atom>

722 <Reliri="http://userv.org/ontology/SeniorDriver">seniorDriver</Rel>

723 </Atom>

724 </meta>

725

726 <!-- If the driver is over the age of 70, then senior driver. -->

727 <Forall>

728 <Vartype="http://userv.org/ontology/Driver">D</Var>

729 <Impliesdirection="backward">

730 <And>

731 <Atom>

732 <Reliri="http://userv.org/ontology/age">age</Rel>

733 <Vartype="http://userv.org/ontology/Driver">D</Var>

734 <Var>A</Var>

735 </Atom>

736

737 <Atom>

738 <Reliri="pred:numeric-greater-than">gt</Rel>

739 <Vartype="xs:positiveInteger">A</Var>

740 <Data xsi:type="xs:integer">70</Data>

741 </Atom>

742 </And>

743

744 <Atom>

745 <Reliri="http://userv.org/ontology/SeniorDriver">seniorDriver</Rel>

Références

Documents relatifs

The translator, PSOA2TPTP, maps knowledge bases and queries in the PSOA RuleML presentation syntax to the popular TPTP interchange language, which is supported by many first-order

At the risk of provoking the charge of medical paternalism, I am con- vinced as a practitioner that one of the most fundamental missions of the medical and health fraternity

In this article, we demonstrate the effectiveness of expressive Datalog + RuleML 1.01 [3] by showcasing a rulebase containing a set of rules and queries over a sub- set of the

This article describes the development of MYNG to Version 1.01 in order to integrate the new Deliberation RuleML Version 1.01 Relax NG schema modules – and the RuleML sublanguages

2. Duty to harmonize the special or regional conventions with the basic principles of this Convention. It is a convenient flexibility to allow the amendment of the application of

It will be said, that a conclusion ought not to be drawn from the unthinking conduct of the great majority of an aristocratical body, against the capability of such a body for

Aware of the grave consequences of Substance abuse, the United Nations system including the World Health Organization have been deeply involved in many aspects of prevention,

We describe the development of RuleML to Version 1.02 in order to integrate a subset of features from Deliberation and Reaction RuleML into a new family of languages called