W3C

Rule interchange

Rules

Rules serialize de-serial. Rules

Data model Rule (OWL, RDF-S, Rule system 1 XML-S, XMI, …) system 2

Data serialize de-serial. Data

Application A data Application B

Rules interchange Is good for compliance Policy compliant Compliance Policy setting organisation organisation organisation (regulated) (regulator) •Specifies Implements operational rules specifies interpretation of (PSM level) rules rules (PIM level) (CIM level) •Merges rules from relevant sources Implements Implemrules ents Impruleslements Implemrules ents rules

Negotiating eCommerce Transactions Through Disclosure of Buyer and Seller Policies and Preferences

• In order to grant access a buyer must provide valid credit card information together with delivery information (address, postal code, city, and country) Forall ?buyer Forall ?card ?address such that (?buyer[ex:creditCard->?card ex:deliveryAddress->?address]) if ex:validAddress(?address) and ex:validCreditCard(?card) then Execute(ex:grantAccess(?buyer)) ex:validAddress(?address) :- Exists ?x ?y ?z … And(?address[ex:zip->?x ex:city->?y ex:country->?z …] ex:isValidZip(?x ?y ?z) …) • Disclose Alice's credit card information only to online shops belonging to the Better Business Bureau • For anonymity reasons, never provide both her birth date and postal code.

Interchanging Rule Extensions to OWL

• “A rule is used to express the dependency between the ontology properties isMAEConnectedTo and isMAEBoundedBy, in particular (a simplified form of) the knowledge that two Material Anatomical Entities having a shared boundary are connected” Forall ?x ?y ?z (?x[isMAEConnectedTo->?y :- And(?x[isMAEBoundedBy->?z] ?y[isMAEBoundedBy->?z]))

Publishing Rules for Interlinked

• Every science fiction movie is a movie ?Movie#ex:Movie :- ?Movie#ex:ScienceFictionMovie • Every movie produced before 1930 is black and white ?Movie#ex:BlackWhiteMovie :- ?Movie#ex:Movie[ex:date -> ?Date], ?Date < "1930"^^xs:dateTime • All movies listed at http://altmd.example.org but not listed at http://imd.example.org are independent movies ?Movie#ex:IndependentMovie :- listed(?Movie#ex:Movie,http://altmd.example.org) not(listed(?Movie#ex:Movie,)) • All movies with budgets below 5 million USD are low-budget movies. ?Movie#ex:LowBudgetMovie :- ?Movie#ex:Movie [date -> ?Date, budget -> ?Budget] ?Budget < 5000000^^xs:long

• All of these can be expressed with OWL, but not all of them belongs in an ontology

Publishing Rules for Interlinked Metadata

• FOAF user Charlie might choose to complement his normal FOAF profile with his preferences about which of his phone numbers should be used depending on his iCalendar schedule: – If Charlie is currently in a meeting according to http://charlie.example.org/calender.ical and the importance is high then call his cell number – If Charlie is currently attending a public talk according to http://charlie.example.org/calender.ical then leave him a voicemail message – If Charlie currently has no appointments according to http://charlie.example.org/calender.ical then call his office number

Access control policies

• PRIME with [] can on with [] for if [] • RIF-BLD Forall ?subject ?object prime:allowed(prime:action ?object prime:purpose) :- And(subject_expression object_expression conditions) • RIF-PRD Forall ?subject such that (subject_expression) Forall ?object such that (object_expression) If conditions then Execute(prime:action(?object prime:purpose))

What is the Rule Interchange Format?

• Format for interchanging rules, so they can be used across diverse systems – allowing rules written for one application to be published, shared, and re-used in other applications and other rule engines. – In a semantic preserving way (between languages with compatible ) – Encouraging interoperability – XML syntax – Compatible with relevant standards (PRR, RDF, OWL, …) • A rule is (just another) data item – RIF provides a standard means to feed rules into an application (at run time) – Semantics to prescribe (intended) application’s behaviour

RIF Background: standards • The early days of rule interchange – 1998: KIF – Knowledge Interchange Format – 2000: RuleML – 2001: SRML – Simple Rule Markup Language (Colleen and Changhai) – … • 2001-2004: JSR 94 – Java rule engine API – Prescribes a set of fundamental rule engine operations (i.e. loading rulesets, parsing rules, adding objects to an engine, firing rules, and getting resultant objects from the engine) – Engine semantics are not defined, so the API and specification are very high level (JDBC API ... without SQL) – No underlying rule language, hence no API to introspect rules, create rulesets, provide pluggable parsers etc. • 2003-2008: OMG PRR – Production Rule Representation – “A metamodel for a language that can be used with UML models for explicitly representing production rules as visible, separate and primary model elements in UML models” • A MOF/UML meta-model and an UML profile • Addresses the PIM level of MDA – Engine semantics are defined (forward chaining + sequential) – No underlying rule language: PRR Core + non-normative PRR OCL • April 2005: W3C workshop on rule languages for interoperability • November 2005: W3C Rule Interchange Format working group chartered • OMG SBVR, ISO Common , … RIF Background:

• Semantic web approach – interoperability requires a formal semantics • The OWL WG approach – Start with something (DAML+OIL) • Literally hundreds of rule system implementations – ISO-Prolog, CLIPS, OPS… – http://www.w3.org/2005/rules/wg/wiki/List_of_Rule_Systems – Already several “SW” rule languages • SWRL, RuleML, WRL, SWSL, KAON2, TRIPLE, JenaRules… – Everyone wants “their” system/technique/theory to be the SW rule standard

Wherefore the RIFt(s)?

• OWL DL < OWL < FOL – Original idea to add full first-order at the logic level – Semantic web very “open world” • Most back-end DBs support closed queries • Many rule systems have non-FO features – CWA/NAF – Procedural Attachment – Rule ordering – Non-monotonicity … can’t be layered on OWL • Not a strict SW layering already – OWL restricted dialects (DL) not layered on (all of) RDF/S semantics – RDF & RDFS not layered at all

RIF Background: Business rules

• “Business Rule systems” Vendors – $1B/year existing market – 1,000’s end users – 1,000,000’s rules in use – ILOG, Fair Isaac, Haley, … • vendors – Oracle, IBM • OMG PRR effort – Simple production rules – Event-condition-action – Vendors understand the value of standardization (see also JSR 94) – Interchange already a priority – …a common semantics?

W3C RIF working group

• W3C working group – Chartered Nov. 05 (for 2 years) • Phase 1: extensible XML rule interchange format, Horn expressiveness, semantic Web compatibility – Kick-off Dec. 05 • March 06: FPWD UCR • March 07: FPWD Core • Oct. 07: FPWD BLD – Extended Nov. 07 (for 6 months) • BLD to Last Call – Extended May 08 (for 1 year) • BLD, SWC to REC • FLD, DTB, PRD, extensibility • 74 participants from 35 organisations – IBM, HP, Oracle, ILOG, JBoss, Fair Isaac, Corticon, Tibco, MITRE… – NIST, OMG (esp. SBVR and PRR), RuleML… – Research organisations, universities… – And 4 invited experts – Chairs: Chris Welty (IBM), Christian de Sainte Marie (ILOG) • Working in the public eye

– http://www.w3.org/2005/rules/wiki/RIF_Working_Group – Under the W3C patent policy W3C RIF: Design issues

• Very large number of rule users/use cases and types to satisfy!!! – Descriptive {OMG MDA level = CIM} VS executable rules {OMG MDA level = PIM & PSM} – Logical (side-effect free) VS active (side-effect full) rules – Data-oriented (SQL triggers, PR, …) VS proof-oriented (FOL…) • All kinds of different data sources (DB, WM, OO, OWL…) – Semantic Web VS non-SW usage • Simplicity VS coverage • Extensibility VS compliance VS interoperability • Executable (AST) VS human-readable syntax • … Superset approach

RLi

RL2 RL1 RLn RLj

superRIF

Super-set approach

• Define a super-language so expressive that any language can be translated to/from it – The CL and IKL approach @deprecated: infeasible for this group, as major differences appeared irreconcilable (e.g. non- mon vs. mon)

A common core…

RL2

RLi

RIF Core RLj RL1

RLn

…and standard dialects RL2 RLi RIF dialect RIF dialect

Core RIF dialect

Core RIF dialect

Core RLj RL1

RLn

Core + standard dialects

• Define a core language that accounts for the intersection of all rule language capabilities – E.g. Horn, datalog, … @postponed: The production rule, logic programming, and FO core is not clear

Separate families + Core

IRL RIF PRD

RIF BLD

RLj JBoss

RLn

Separate families + Core

IRL

RIF PRD

Core

RIF BLD

RLj JBoss

RLn

Separate families + Core

• Define a logic-based core and a separate production-rule core • If there is an intersection, define the common core (which may possibly be just a syntax) @version 0.1: BLD LC (July 08) @version 0.0.1: PRD FPWD (July 08)

Approach 3a

• Define a framework in the form of a menu of syntactic and semantic features that can be combined into dialects – @version 0.0.9: FLD

Design principles • Translation paradigm – No intrusion in covered rule languages and rule sets • Same semantics ⇔ same syntax – Share constructs accross dialects wherever they agree on the semantics – Different constructs where semantics do not agree • Fully striped XML (type-tagged, object-oriented, …) – alternating Class and role tags – Metadata can be attached to any class element • Only XML schema is normative – Presentation syntax added for specification’s readability (examples, semantics etc)

• Principles are there so you can rest on them…until they

break BLD Overview

• Definite Horn rules – Disjunction of atoms with exactly one positive literal • Equality, functions, and a standard first-order semantics • Syntactic features – objects and frames – internationalized resource identifiers (IRIs) as identifiers – XML Schema data types and builtins • XML (1.0) syntax with normative XMLS definition • Non-normative presentation syntax • Metadata and (RDF+OWL) imports

Symbols

• Used to identify constants, variables, functions, predicates • "literal"^^ – Notable symbol spaces: xsd:string, rif:local, rif:iri – “Chris”^^ – “ http://www.w3.org/1999/02/22-rdf-syntax-ns#type”^^< rif:iri> – “Person1”^^rif:local

Rules

• IF THEN aka rule body, antecedent – aka rule head, consequent • BLD rule: – (Forall var* :- ) – Conclusions may contain conjunction – Conditions may contain conjunction, disjunction, and existential • Restrictions on conclusion – No existential, disjunction, external functions

Horn Extensions

• Functions and external calls (DTB) • Equality (in conclusion and condition) • Frames – Objects with slots and (multiple) values • Used to map to RDF and OWL (SWC) – Special syntactic treatment of class membership and subclass • Named argument functions and predicates – However all arguments must be provided

Structure

• Rules occur in Groups Group( (Forall ?x _Q(?x) :- _P(?x)) (Forall ?x _Q(?x) :- _R(?x)) ) • Groups occur in Documents Document( Group((Forall ?x _Q(?x) :- _P(?x)) (Forall ?x _Q(?x) :- _R(?x))))

Warning

• While representative of the RIF syntax, the following diagrams and examples are not completely up-to-date at the time of the presentation

PRD Overview

• Production rules – FOR WITH , IF THEN – FORALL Var* (IF patterns AND condition THEN action – With an operational semantics a a labelled transition system • Patterns and condition – BLD condition language minus logic functions plus negation – With a model-theoretic semantics (compatible with BLD) • Assert, Retract, New – Assign, Remove, Execute – Defining a transition relation • Syntactic features – objects and frames – internationalized resource identifiers (IRIs) as identifiers – XML Schema data types and builtins • Metadata

TERM

Any Unicode string

any Unicode string

Const TERM* ? ATOMIC

ATOMIC • jim:owns(?c ?p) http://rif.examples.com/2008/jim#owns ?c ?p • ?c.age = ?a ?c ttp://rif.examples.com/2008/jim#Chicken/age ?a FORMULA

• Exists Chicken(age>8) FORMULA ?c ?a ?c jim:Chicken ?c.age=?a op:numeric-greater-than ?a 8

RULE etc

RULE • When ?c Chicken(age==8) evaluate(today()=’’Monday’’) Then … ?c ?c jim:Chicken ?c.age=8 today()=’’Monday’’ Metadata

Const ? type="rif:iri“>jim:CMP [ Frame dc:creator csma ? … other CLASSELT content ?c RIF Documents

• BLD: RIF basic logic dialect – LC July 2008 – REC by May 2009? • FLD: RIF framework for logic dialects – 2nd public WD July 2008 – LC November 2008? • PRD: RIF production rule dialect – FPWD July 2008 – LC May 2009? • DTB: RIF data types and builtins – FPWD July 2008 – LC November 2008? • SWC: RIF RDF and OWL compatibility – LC July 2008 – REC by May 2008? • UCR: RIF use cases and requirements – 4th public WD July 2008 • Test Cases: FPWD November 2008

Web site: http://www.w3.org/2005/rules/w iki/RIF_Working_Group Credits

• BLD and FLD Editors – Michael Kifer (U. Stonybrook), Harold Boley (NRCC) • PRD Editors – Christian de Sainte Marie (ILOG), Adrian Paschke (FUBerlin), Gary Hallmark (ORACLE) • SWC Editor – Jos de Bruijn (FUB) • DTB Editors – Axel Polleres (DERI Galway)? Michael Kifer (U. Stonybrook), Harold Boley (NRCC) • UCR Editors – Adrian Paschke (TU Dresden)? David Hirtle (NRCC), Allen Ginsberg (Mitre), Paula-Lavinia Patranjan (REWERSE), Frank McCabe (Fujitsu) • Test Cases Editors – Stella Mitchell (IBM), Leora Morgenstern (IBM), Adrian Paschke (FUBerlin) • Active WG members – Adrian Paschke (FUBerlin), Axel Polleres (DERI), Dave Reynolds (HP), Gary Hallmark (ORACLE), Hassan Aït-Kaci (ILOG), Igor Mozetic (JFI), John Hall (OMG), Jos de Bruijn (FUB), Leora Morgenstern (IBM), Mike Dean (SRI), Stella Mitchell (IBM), Changhai Ke (ILOG), Stuart Taylor (U Aberdeen) • WG Team – Chris Welty (IBM), Christian de Sainte Marie (ILOG), and Sandro Hawke (W3C/MIT)

Thank you!

Questions?