SlideShare a Scribd company logo
1 of 23
Experiences Using 
Deliberation RuleML 1.01 as 
a Rule Interchange Language 
Do Rulebases Need an External Vocabulary? 
Matthias Tylkowski and Martin Müller 
Binarypark, Erich-Weinertstr. 1, 03044 Cottbus, Germany 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014
RuleML Basics 
• Individuals, Data, Atomic statements, logical 
formulas, rules, quantifiers 
• Hierarchical sub-languages – RuleML lattice 
• Support for various semantics 
• Schema configurability via MYNG 1.01 
• Design based on Relax NG and XML Schema 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 2
UServ Product Derby 
• Describes a virtual car insurance company 
• Business model based on business rules 
• Traditional object-oriented data model 
o classes (Car, Driver, ConvertibleCar, …), 
o properties (price, eligibilityScore, potentialTheftRating ) 
o objects (car1, car2, …) 
If all of the following are true, then the car’s potential theft rating is low: 
- car’s price is less that $20,000 
- car model is not on the list of “High Theft Probability Auto” 
Any senior driver is not a young driver. 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
3
Individuals, Data and Variables (1) 
RuleML Support: 
• IRIs (@iri) to provide unique names for individuals. Typing 
of individuals (@type) 
• Declaration of property values for individuals. 
<Atom> 
<oid> 
<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" 
type="http://userv.org/ontology/LuxuryCar"> 
</Ind> 
</oid> 
<slot> 
<Rel iri="http://userv.org/ontology/price">price</Rel> 
<Data xsi:type="xs:positiveInteger">39000</Data> 
</slot> 
</Atom> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
4
Individuals, Data and Variables (2) 
RuleML Support: 
• Best practice of declarative definition of instances (facts) 
by atoms/formulas (푙푢푥푢푟푦퐶푎푟 becomes a type) 
<Assert> 
푙푢푥푢푟푦퐶푎푟 푐푎푟4 ∧ 푐푎푟푀표푑푒푙 푐푎푟4, ′Honda Odyssey′ ∧ 푝푟푖푐푒 푐푎푟4, 39000 . 
<Atom> 
<Rel iri="http://userv.org/ontology/carModel"/> 
<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" 
type="http://userv.org/ontology/LuxuryCar">car4</Ind> 
<Data xsi:type="xs:string">Honda Odyssey</Data> 
</Atom> 
<Atom> 
<Rel iri="http://userv.org/ontology/price">price</Rel> 
<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" 
type="http://userv.org/ontology/LuxuryCar">car4</Ind> 
<Data xsi:type="xs:positiveInteger">39000</Data> 
</Atom> 
</Assert> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
5
Individuals, Data and Variables (3) 
RuleML Support: 
• Beyond the logic programming tradition, allows typing of XML 
data(@xsi:type). However, only RuleML supported XML 
datatypes are permitted. 
• Typed variables (@type). 
<Data xsi:type="xs:positiveInteger">39000</Data> 
<Var type="http://userv.org/ontology/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> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
6 
• No typing of User-defined structured data
UServ - Design 
• Object instances (such as specific cars) map to 
RuleML individuals 
• Classes map to RuleML unary relations. 
• Type classification (aka classes) can also be 
declared explicitly inside typed variables or typed 
individuals 
• Properties map to RuleML binary relations 
• Rules are based on ontology models 
• UServ rules are based on relations and properties 
defined by an external ontology (accessible via 
RuleML @type ) – the rule vocabulary . 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
7
Encoding Types/Classes 
RuleML Support: 
• Type/class encoding using variables or individuals 
• Type/class encoding using atoms with unary relations 
<Ind type="us:Car">car4</Ind> 
<Var type="us:Car">C</Var> 
<Atom> 
<Rel iri="us:Car">car</Rel> 
<Var>C</Var> 
</Atom> 
∀퐶 푐푎푟(퐶) 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
8 
푐푎푟(푐푎푟4)
Multi-typing 
RuleML Support: 
• Explicit typing of individuals 
<Assert> 
푐푎푟 푐푎푟1 ∧ 푐표푛푣푒푟푡푖푏푙푒퐶푎푟(푐푎푟1) 
<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> 
</Assert> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
9
Inheritance (1) 
RuleML Support: 
• No internal subClassOf inheritance support 
• Define inheritance externally (e.g. RDFS) or via of rules 
<Implies> 
<Atom> 
∀퐶 푐표푛푣푒푟푡푖푏푙푒퐶푎푟 퐶 → 푐푎푟(퐶) 
<Rel iri="us:ConvertibleCar">convertibleCar</Rel> 
<Var>X</Var> 
</Atom> 
<Atom> 
<Rel iri="us:Car">car</Rel> 
<Var>X</Var> 
</Atom> 
</Implies> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
10
Inheritance (2) 
RuleML Support: 
• Rule-based inheritance may introduce complexity in execution. 
• Usually search (backtracking) used for multiple inheritance 
• Keep inheritance in external vocabulary or use higher-order syntax 
<owl:Class rdf:about="http://userv.org/ontology/ConvertibleCar"> 
<rdfs:subClassOf rdf:resource="http://userv.org/ontology/Car"/> 
</owl:Class> 
<Atom> 
<Rel iri="rdfs:subClassOf">subClassOf</Rel> 
<arg index="1"> 
<Rel iri="us:ConvertibleCar" type="owl:Class">convertibleCar</Rel> 
</arg> 
<arg index="2"> 
<Plex> 
∀퐶 ([푐표푛푣푒푟푡푖푏푙푒퐶푎푟 퐶 → 푐푎푟 퐶 ] ∨ [푐표푛푣푒푟푡푖푏푙푒퐶푎푟 퐶 → 푙푢푥푢푟푦퐶푎푟 퐶 ]). 
<Rel iri="us:Car" type="owl:Class">car</Rel> 
<Rel iri="us:LuxuryCar" type="owl:Class">luxuryCar</Rel> 
</Plex> 
</arg> 
</Atom> 
퐶표푛푣푒푟푡푖푏푙푒퐶푎푟 ⊑ 퐶푎푟 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
11
Encoding Properties (1) 
<Atom> 
<Rel iri="us:price">price</Rel> 
<!-- the subject of the property --> 
<Var type="us:Car">C</Var> 
<!-- the value of the property --> 
<Data xsi:type="xs:positiveInteger">25000</Data> 
</Atom> 
<Atom> 
∀퐶 푐푎푟(퐶) ∧ 푝푟푖푐푒 퐶, 25000 . 
luxuryCar (푐푎푟4) ∧ 푝푟푖푐푒 푐푎푟4, 39000 . 
<Rel iri="us:price">price</Rel> 
<Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" 
type="http://userv.org/ontology/LuxuryCar">car4</Ind> 
<Data xsi:type="xs:positiveInteger">39000</Data> 
</Atom> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
12
Encoding Properties(2) 
<Atom> 
<Rel iri="us:theftRating">theftRating</Rel> 
<Var type="http://userv.org/ontology/LuxuryCar">C</Var> 
<Data type="us:Rating" > 
<us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue> 
<us:ratingVerbalization xsi:type="xs:string" xml:lang="en"> 
high 
</us:ratingVerbalization> 
</Data> 
</Atom> 
<Atom> 
∀퐶 푙푢푥푢푟푦퐶푎푟 퐶 ∧ 푡ℎ푒푓푡푅푎푡푖푛푔 퐶, 푟푎푡푖푛푔(4, ′high′) . 
<Rel iri="us:airbag">airbags</Rel> 
<Var type="http://userv.org/ontology/Car">C</Var> 
<Plex> 
<Data xsi:type="xs:string">driverAirbag</Data> 
<Data xsi:type="xs:string">frontAirbag</Data> 
</Plex> 
</Atom> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
13 
∀퐶 푐푎푟 퐶 ∧ 푎푖푟푏푎푔푠 퐶, [′driverAirbag′, ′푓푟표푛푡퐴푖푟푏푎푔′]
Encoding Properties (3) 
• Definition of properties via external ontology 
<Atom> 
<Rel iri="us:price">price</Rel> 
<Var type="us:Car">C</Var> 
<Plex> 
<Data xsi:type="xs:string">high</Data> 
<Data xsi:type="xs:positiveInteger">25000</Data> 
</Plex> 
</Atom> 
<owl:DatatypeProperty 
rdf:about="http://userv.org/ontology/price"> 
<rdfs:domain rdf:resource=http://userv.org/ontology/Car/> 
<rdfs:range> 
<owl:Class> 
<owl:unionOf rdf:parseType="Collection"> 
<owl:Class rdf:about="xs:positiveInteger"/> 
<owl:Class rdf:about="xs:string"/> 
</owl:unionOf> 
</owl:Class> 
</rdfs:range> 
</owl:DatatypeProperty> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
14
Built-ins 
RuleML Support: 
• Tests such as for numerical constraints and list memberships 
• Operators with an @iri attribute refer to libraries of built-in 
predicates such as one defined by RIF 
<Atom> 
푃 ≤ 45000. 
<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 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
15
Collection membership (1) 
RuleML Support: 
• List membership tests via use of collections (<Plex>) in atoms 
<Atom> 
<Rel iri="prolog:member">member</Rel> 
<Var>M</Var> 
<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> 
</Plex> 
</Atom> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
16
Collection membership (2) 
RuleML Support: 
• Collections must be repeatedly given wherever needed 
• Best practice to define collection constants via equality 
<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> 
</Plex> 
</Equal> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
17
Rules and Rulebases (1) 
RuleML Support: 
• Rules are defined similarly with logical implications, but 
many flavours are supported. A rulebase is a set of rules. 
<Implies direction="backward"> 
<Naf> 
<Atom> 
If the car is a convertible and has no roll 
bar, then the potential occupant injury is 
extremely high. 
<Rel iri="http://userv.org/ontology/hasRollBar">hasRollBar</Rel> 
<Var type="http://userv.org/ontology/ConvertibleCar">C</Var> 
</Atom> 
</Naf> 
<Atom> 
<Rel iri="http://userv.org/ontology/injuryRating">injuryRating</Rel> 
<Var>C</Var> 
<Data><us:Value xsi:type="xs:positiveInteger">5</us:Value></Data> 
</Atom> 
</Implies> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
18
Rules and Rulebases (2) 
RuleML Support: 
• Limited support for annotations of rulebases: 
o Logic programming defines a relation by rules. All rules referring 
that relation are grouped 
o Production rules define a rulebase towards performing a 
specific task 
• No global identity for rulebases (@iri) 
<Rulebase xml:id="theftRating"> 
<!-- Processing cars' theftRating --> 
<meta> 
<Atom> 
<Rel iri="http://userv.org/ontology/theftRating">theftRating</Rel> 
</Atom> 
</meta> 
… 
</Rulebase> 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
19
Rulebase Metrics 
• This rulebase covers around 40% of the use case 
• We encoded: 
o 30 rules 
o 32 predicates, 5 built-ins 
o 11 compound facts, 5 descriptions of individuals 
o 7 usages of Naf 
o 2 usages of Neg 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 20
Conclusion 
• RuleML 1.01 can be used as a rule interchange language 
• Improvements on handling types, inheritance, collections 
and global constants are possible 
• UServ design used classes and properties, defined by the 
UServ ontology 
• Our knowledge base uses NafNegHornlogEq family 
• However, except for collections we do not use functions 
("Datalog with Plex") 
• Equality is used only to define collections as individuals 
• Strong negation is used twice because of an explicit 
negative information 
• NafDatalog+FiniteCollections would be great 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 
21
Acknowledgments 
We would like to thank to Tara Athan, Harold Boley, 
Adrian Giurca and Adrian Paschke for their essential 
feedback and insights. 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 22
Useful information sources 
• Tutorial introduction (http://ruleml.org/papers/Primer) 
• RuleML MediaWiki (http://wiki.ruleml.org) 
• RuleML Blog & Social Mediazine 
(http://blog.ruleml.org) 
• Mailing lists 
(http://wiki.ruleml.org/index.php/Mailing_Lists) 
• Technical Groups 
(http://wiki.ruleml.org/index.php/Technical_Groups) 
• RuleML sources hosted on Github 
(https://github.com/RuleML) 
The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 23

More Related Content

Viewers also liked (7)

Presentasi Student Exchange
Presentasi Student ExchangePresentasi Student Exchange
Presentasi Student Exchange
 
Jan
JanJan
Jan
 
Microdata for dummies
Microdata for dummiesMicrodata for dummies
Microdata for dummies
 
Sistem pengolahan dataaaaa
Sistem pengolahan dataaaaaSistem pengolahan dataaaaa
Sistem pengolahan dataaaaa
 
Jannus en coen
Jannus en coenJannus en coen
Jannus en coen
 
Lookin headhunt about
Lookin headhunt aboutLookin headhunt about
Lookin headhunt about
 
VS 3 Resipi episod 3
VS 3 Resipi episod 3VS 3 Resipi episod 3
VS 3 Resipi episod 3
 

Similar to Experiences Using Deliberation RuleML 1.01 as a Rule Interchange Language

OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
Sanjay Patel
 
Schematron step-by-step
Schematron step-by-stepSchematron step-by-step
Schematron step-by-step
Octavian Nadolu
 

Similar to Experiences Using Deliberation RuleML 1.01 as a Rule Interchange Language (20)

SAPS - Semantic AtomPub-based Services
SAPS - Semantic AtomPub-based ServicesSAPS - Semantic AtomPub-based Services
SAPS - Semantic AtomPub-based Services
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml Tools
 
NoSQL Now 2013 Presentation
NoSQL Now 2013 PresentationNoSQL Now 2013 Presentation
NoSQL Now 2013 Presentation
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
 
An approach for knowledge-driven product, process and resource mappings for a...
An approach for knowledge-driven product, process and resource mappings for a...An approach for knowledge-driven product, process and resource mappings for a...
An approach for knowledge-driven product, process and resource mappings for a...
 
xml rpc
xml rpcxml rpc
xml rpc
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
 
Constraints Make You Sexy - What is Rest
Constraints Make You Sexy  - What is RestConstraints Make You Sexy  - What is Rest
Constraints Make You Sexy - What is Rest
 
Just Another QSAR Project under OpenTox
Just Another QSAR Project under OpenToxJust Another QSAR Project under OpenTox
Just Another QSAR Project under OpenTox
 
Ajax
AjaxAjax
Ajax
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
6 10-presentation
6 10-presentation6 10-presentation
6 10-presentation
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
 
REST Easy with AngularJS - ng-grid CRUD Example
REST Easy with AngularJS - ng-grid CRUD ExampleREST Easy with AngularJS - ng-grid CRUD Example
REST Easy with AngularJS - ng-grid CRUD Example
 
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
 
Industry Ontologies: Case Studies in Creating and Extending Schema.org
Industry Ontologies: Case Studies in Creating and Extending Schema.org Industry Ontologies: Case Studies in Creating and Extending Schema.org
Industry Ontologies: Case Studies in Creating and Extending Schema.org
 
Schematron step-by-step
Schematron step-by-stepSchematron step-by-step
Schematron step-by-step
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
 
Strigil - lightning talks
Strigil - lightning talksStrigil - lightning talks
Strigil - lightning talks
 

Recently uploaded

Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
Sheetaleventcompany
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 

Recently uploaded (20)

BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 

Experiences Using Deliberation RuleML 1.01 as a Rule Interchange Language

  • 1. Experiences Using Deliberation RuleML 1.01 as a Rule Interchange Language Do Rulebases Need an External Vocabulary? Matthias Tylkowski and Martin Müller Binarypark, Erich-Weinertstr. 1, 03044 Cottbus, Germany The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014
  • 2. RuleML Basics • Individuals, Data, Atomic statements, logical formulas, rules, quantifiers • Hierarchical sub-languages – RuleML lattice • Support for various semantics • Schema configurability via MYNG 1.01 • Design based on Relax NG and XML Schema The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 2
  • 3. UServ Product Derby • Describes a virtual car insurance company • Business model based on business rules • Traditional object-oriented data model o classes (Car, Driver, ConvertibleCar, …), o properties (price, eligibilityScore, potentialTheftRating ) o objects (car1, car2, …) If all of the following are true, then the car’s potential theft rating is low: - car’s price is less that $20,000 - car model is not on the list of “High Theft Probability Auto” Any senior driver is not a young driver. The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 3
  • 4. Individuals, Data and Variables (1) RuleML Support: • IRIs (@iri) to provide unique names for individuals. Typing of individuals (@type) • Declaration of property values for individuals. <Atom> <oid> <Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" type="http://userv.org/ontology/LuxuryCar"> </Ind> </oid> <slot> <Rel iri="http://userv.org/ontology/price">price</Rel> <Data xsi:type="xs:positiveInteger">39000</Data> </slot> </Atom> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 4
  • 5. Individuals, Data and Variables (2) RuleML Support: • Best practice of declarative definition of instances (facts) by atoms/formulas (푙푢푥푢푟푦퐶푎푟 becomes a type) <Assert> 푙푢푥푢푟푦퐶푎푟 푐푎푟4 ∧ 푐푎푟푀표푑푒푙 푐푎푟4, ′Honda Odyssey′ ∧ 푝푟푖푐푒 푐푎푟4, 39000 . <Atom> <Rel iri="http://userv.org/ontology/carModel"/> <Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" type="http://userv.org/ontology/LuxuryCar">car4</Ind> <Data xsi:type="xs:string">Honda Odyssey</Data> </Atom> <Atom> <Rel iri="http://userv.org/ontology/price">price</Rel> <Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" type="http://userv.org/ontology/LuxuryCar">car4</Ind> <Data xsi:type="xs:positiveInteger">39000</Data> </Atom> </Assert> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 5
  • 6. Individuals, Data and Variables (3) RuleML Support: • Beyond the logic programming tradition, allows typing of XML data(@xsi:type). However, only RuleML supported XML datatypes are permitted. • Typed variables (@type). <Data xsi:type="xs:positiveInteger">39000</Data> <Var type="http://userv.org/ontology/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> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 6 • No typing of User-defined structured data
  • 7. UServ - Design • Object instances (such as specific cars) map to RuleML individuals • Classes map to RuleML unary relations. • Type classification (aka classes) can also be declared explicitly inside typed variables or typed individuals • Properties map to RuleML binary relations • Rules are based on ontology models • UServ rules are based on relations and properties defined by an external ontology (accessible via RuleML @type ) – the rule vocabulary . The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 7
  • 8. Encoding Types/Classes RuleML Support: • Type/class encoding using variables or individuals • Type/class encoding using atoms with unary relations <Ind type="us:Car">car4</Ind> <Var type="us:Car">C</Var> <Atom> <Rel iri="us:Car">car</Rel> <Var>C</Var> </Atom> ∀퐶 푐푎푟(퐶) The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 8 푐푎푟(푐푎푟4)
  • 9. Multi-typing RuleML Support: • Explicit typing of individuals <Assert> 푐푎푟 푐푎푟1 ∧ 푐표푛푣푒푟푡푖푏푙푒퐶푎푟(푐푎푟1) <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> </Assert> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 9
  • 10. Inheritance (1) RuleML Support: • No internal subClassOf inheritance support • Define inheritance externally (e.g. RDFS) or via of rules <Implies> <Atom> ∀퐶 푐표푛푣푒푟푡푖푏푙푒퐶푎푟 퐶 → 푐푎푟(퐶) <Rel iri="us:ConvertibleCar">convertibleCar</Rel> <Var>X</Var> </Atom> <Atom> <Rel iri="us:Car">car</Rel> <Var>X</Var> </Atom> </Implies> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 10
  • 11. Inheritance (2) RuleML Support: • Rule-based inheritance may introduce complexity in execution. • Usually search (backtracking) used for multiple inheritance • Keep inheritance in external vocabulary or use higher-order syntax <owl:Class rdf:about="http://userv.org/ontology/ConvertibleCar"> <rdfs:subClassOf rdf:resource="http://userv.org/ontology/Car"/> </owl:Class> <Atom> <Rel iri="rdfs:subClassOf">subClassOf</Rel> <arg index="1"> <Rel iri="us:ConvertibleCar" type="owl:Class">convertibleCar</Rel> </arg> <arg index="2"> <Plex> ∀퐶 ([푐표푛푣푒푟푡푖푏푙푒퐶푎푟 퐶 → 푐푎푟 퐶 ] ∨ [푐표푛푣푒푟푡푖푏푙푒퐶푎푟 퐶 → 푙푢푥푢푟푦퐶푎푟 퐶 ]). <Rel iri="us:Car" type="owl:Class">car</Rel> <Rel iri="us:LuxuryCar" type="owl:Class">luxuryCar</Rel> </Plex> </arg> </Atom> 퐶표푛푣푒푟푡푖푏푙푒퐶푎푟 ⊑ 퐶푎푟 The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 11
  • 12. Encoding Properties (1) <Atom> <Rel iri="us:price">price</Rel> <!-- the subject of the property --> <Var type="us:Car">C</Var> <!-- the value of the property --> <Data xsi:type="xs:positiveInteger">25000</Data> </Atom> <Atom> ∀퐶 푐푎푟(퐶) ∧ 푝푟푖푐푒 퐶, 25000 . luxuryCar (푐푎푟4) ∧ 푝푟푖푐푒 푐푎푟4, 39000 . <Rel iri="us:price">price</Rel> <Ind iri="http://userv.org/ontology/i/a9fccd3a-a851-4e80-de3a8c2e15ba" type="http://userv.org/ontology/LuxuryCar">car4</Ind> <Data xsi:type="xs:positiveInteger">39000</Data> </Atom> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 12
  • 13. Encoding Properties(2) <Atom> <Rel iri="us:theftRating">theftRating</Rel> <Var type="http://userv.org/ontology/LuxuryCar">C</Var> <Data type="us:Rating" > <us:ratingValue xsi:type="xs:positiveInteger">4</us:ratingValue> <us:ratingVerbalization xsi:type="xs:string" xml:lang="en"> high </us:ratingVerbalization> </Data> </Atom> <Atom> ∀퐶 푙푢푥푢푟푦퐶푎푟 퐶 ∧ 푡ℎ푒푓푡푅푎푡푖푛푔 퐶, 푟푎푡푖푛푔(4, ′high′) . <Rel iri="us:airbag">airbags</Rel> <Var type="http://userv.org/ontology/Car">C</Var> <Plex> <Data xsi:type="xs:string">driverAirbag</Data> <Data xsi:type="xs:string">frontAirbag</Data> </Plex> </Atom> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 13 ∀퐶 푐푎푟 퐶 ∧ 푎푖푟푏푎푔푠 퐶, [′driverAirbag′, ′푓푟표푛푡퐴푖푟푏푎푔′]
  • 14. Encoding Properties (3) • Definition of properties via external ontology <Atom> <Rel iri="us:price">price</Rel> <Var type="us:Car">C</Var> <Plex> <Data xsi:type="xs:string">high</Data> <Data xsi:type="xs:positiveInteger">25000</Data> </Plex> </Atom> <owl:DatatypeProperty rdf:about="http://userv.org/ontology/price"> <rdfs:domain rdf:resource=http://userv.org/ontology/Car/> <rdfs:range> <owl:Class> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="xs:positiveInteger"/> <owl:Class rdf:about="xs:string"/> </owl:unionOf> </owl:Class> </rdfs:range> </owl:DatatypeProperty> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 14
  • 15. Built-ins RuleML Support: • Tests such as for numerical constraints and list memberships • Operators with an @iri attribute refer to libraries of built-in predicates such as one defined by RIF <Atom> 푃 ≤ 45000. <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 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 15
  • 16. Collection membership (1) RuleML Support: • List membership tests via use of collections (<Plex>) in atoms <Atom> <Rel iri="prolog:member">member</Rel> <Var>M</Var> <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> </Plex> </Atom> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 16
  • 17. Collection membership (2) RuleML Support: • Collections must be repeatedly given wherever needed • Best practice to define collection constants via equality <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> </Plex> </Equal> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 17
  • 18. Rules and Rulebases (1) RuleML Support: • Rules are defined similarly with logical implications, but many flavours are supported. A rulebase is a set of rules. <Implies direction="backward"> <Naf> <Atom> If the car is a convertible and has no roll bar, then the potential occupant injury is extremely high. <Rel iri="http://userv.org/ontology/hasRollBar">hasRollBar</Rel> <Var type="http://userv.org/ontology/ConvertibleCar">C</Var> </Atom> </Naf> <Atom> <Rel iri="http://userv.org/ontology/injuryRating">injuryRating</Rel> <Var>C</Var> <Data><us:Value xsi:type="xs:positiveInteger">5</us:Value></Data> </Atom> </Implies> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 18
  • 19. Rules and Rulebases (2) RuleML Support: • Limited support for annotations of rulebases: o Logic programming defines a relation by rules. All rules referring that relation are grouped o Production rules define a rulebase towards performing a specific task • No global identity for rulebases (@iri) <Rulebase xml:id="theftRating"> <!-- Processing cars' theftRating --> <meta> <Atom> <Rel iri="http://userv.org/ontology/theftRating">theftRating</Rel> </Atom> </meta> … </Rulebase> The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 19
  • 20. Rulebase Metrics • This rulebase covers around 40% of the use case • We encoded: o 30 rules o 32 predicates, 5 built-ins o 11 compound facts, 5 descriptions of individuals o 7 usages of Naf o 2 usages of Neg The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 20
  • 21. Conclusion • RuleML 1.01 can be used as a rule interchange language • Improvements on handling types, inheritance, collections and global constants are possible • UServ design used classes and properties, defined by the UServ ontology • Our knowledge base uses NafNegHornlogEq family • However, except for collections we do not use functions ("Datalog with Plex") • Equality is used only to define collections as individuals • Strong negation is used twice because of an explicit negative information • NafDatalog+FiniteCollections would be great The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 21
  • 22. Acknowledgments We would like to thank to Tara Athan, Harold Boley, Adrian Giurca and Adrian Paschke for their essential feedback and insights. The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 22
  • 23. Useful information sources • Tutorial introduction (http://ruleml.org/papers/Primer) • RuleML MediaWiki (http://wiki.ruleml.org) • RuleML Blog & Social Mediazine (http://blog.ruleml.org) • Mailing lists (http://wiki.ruleml.org/index.php/Mailing_Lists) • Technical Groups (http://wiki.ruleml.org/index.php/Technical_Groups) • RuleML sources hosted on Github (https://github.com/RuleML) The 8th International Web Rule Symposium Prague, Czech Republic, August 18-20, 2014 23

Editor's Notes

  1. The "extension" of a class/type is the set of all instances belonging to that class. car(car1) – car1 is instanceOf Car price(car1, 39000) – two arguments Rules are based on ontology models: - Car, LuxuryCar, Driver – ontology classes - price, carModel - ontology properties. While in traditional logic programming they are just symbols in an ontology one can check the domain and range of a property (binary predicate) and so on Otherwise logic programming comes with n-ary predicates more difficult to be represented by traditional ontology languages such as OWL and RDFS