object-oriented ruleml: user-level roles, uri-grounded clauses, and order-sorted terms harold boley,...

43
Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel Island, FL October 20th, 2003 (RuleML SC Revision: Jan 28th, 2004)

Upload: kyler-greenway

Post on 28-Mar-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

Object-Oriented RuleML:User-Level Roles, URI-Grounded Clauses,

and Order-Sorted Terms

Harold Boley, NRC

IIT e-Business, Fredericton

RuleML-2003Sanibel Island, FLOctober 20th, 2003(RuleML SC Revision: Jan 28th, 2004)

Page 2: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML2

Overview: RuleML as Semantic Web Logic 2000: XML-encoded positional-argument rules (Prolog)

2002: Frame-like knowledge representation with

user-level role-filler slots as unordered arguments (F-Logic)

2001: 'Webized' knowledge representation (RDF);

URIs as optional additions to, or substitutes for– individual constants

– relation and function symbols

URIs also in clause (fact and imp) and rulebase labels

2002/3: Taxonomy access for order-sorted variables;

webized by typing of RuleML variables via Semantic Web

taxonomies such as RDF Schema class hierarchies

Page 3: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML3

OO RuleML as OO Cube

Object-Oriented RuleML (OO RuleML) conceived as the

orthogonal combination of User-Level Roles,

URI-Grounded Clauses, and Order-Sorted Terms

Orthogonal dimensions constitute three declarative

OO sublanguages visualized as edges of an 'OO cube',

i.e. can be used

– independently from each other

– or can be freely combined, as follows:

Page 4: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML4

Dimension 1: User-Level Roles

The OO contribution of

1. User-Level Roles is to allow 'object-centered' sets of

role-filler slots – much like

• role-type slots of classes and

• role-value slots of their instances

Because of unorderedness of slot sets,

inheritance of slots easier

than that of ordered argument sequences

Page 5: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML5

Dimensions 2 and 3: URI Grounding and Order-Sortedness

The OO contribution of

2. URI-Grounding is the provision

of URIs as unique object identifiers (OIDs) for facts

– much like instances – and for rules – much like methods

3. Order-Sortedness is making taxonomies available as

declarative inheritance pathways for term typing –

much like class hierarchies

Page 6: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML8

Main Structure of the Talk

Object Centering via User-Level Roles

URI Grounding of Clauses

Term Typing via Order-Sorted Taxonomies

Page 7: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML9

Next in the Talk

Object Centering via User-Level Roles

URI Grounding of Clauses

Term Typing via Order-Sorted Taxonomies

Page 8: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML10

Predicate-Centered / Object-Centered KR

In predicate-centered or positional KR (pKR) , one predicate symbol is focused, and applied to positionally ordered objects as arguments

In object-centered or roled KR (rKR), one object identifier is focused, and associated via property roles, unordered, with other objects as arguments

Since the beginnings of knowledge representation,there have been two paradigms, called here

position-keyed and role-keyed KR

Differ in the two natural focus points andargument-access methods of representations:

Page 9: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML11

Positional/Roled Web KR

A kind of pKR came back with XML, because its parent elements are focus points 'applied to' its ordered child elements

A kind of rKR came back with RDF, since its descriptions focus a resource that has properties associating it, unordered, with other objects

In the Web, versions of both paradigms re-surfaced:

Finding common data model as the basis of Web KRthus became foundational issue for the Semantic Web

Page 10: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML12

Unified Positional-Roled KR

RuleML 0.8: pKR-rKR-unifying data modelgeneralizing XML and RDF to express clauses

However, RuleML 0.8 permits only system roles,their names cannot come from application domain,and atoms within clauses are still predicate-oriented

A pKR example will illustrate this 'system-level' solution:

Consider a ternary offer relationapplied to ordered arguments for the

offer name, category, and price

Page 11: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML13

Positional & System-Roled: ExampleAn offer of an Ecobile can be categorized asspecial and priced at 20000 via the following fact:

offer(Ecobile,special,20000).

In RuleML 0.8 this has been marked up thus(_rlab role provides clause labels as ind types):<fact> <_rlab><ind>pKR fact 1</ind></_rlab> <_head> <atom> <_opr><rel>offer</rel></_opr> <ind>Ecobile</ind> <ind>special</ind> <ind>20000</ind> </atom> </_head></fact>

system roles

Page 12: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML14

The fact type has a _head role associating it with

an atom type

The atom, however, usesa role, _opr, only for its operator association with

the rel(ation) type

The three arguments of typeind(ividual) are immediate atom childrenordered in the spirit of XML and pKR

Thus, while the _opr role can be moved fromthe prefix position to a postfix position withoutchanging its meaning, the ind types aresemantically attached to their relative positions

Positional & System-Roled: Issue (I)

Page 13: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML15

Positional & System-Roled: Issue (II)

This fact representation thus requires

users and applications (e.g., XSLT)

to 'store' the correct interpretation

of the three arguments separately ( signatures),

and any extension by additional arguments

requires changes to these positional interpretations,

except when new arguments are always

added at the (right) end only

Page 14: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML16

User-Roled & System-Roled: Example'User-level' solution in the spirit of RDF and rKR thus is tointroduce (user-level) roles name, category, and pricefor the arguments. Our offer can then be representedin POSL in plain ASCII as follows (inspired by F-Logic):offer(name->Ecobile; category->special; price->20000).

In OO RuleML this can be marked up thus:<fact> <_rlab><ind>rKR fact 1</ind></_rlab> <_head> <atom> <_opr><rel>offer</rel></_opr> <_slot name="name"><ind>Ecobile</ind></_slot> <_slot name="category"><ind>special</ind></_slot> <_slot name="price"><ind>20000</ind></_slot> </atom> </_head></fact>

userroles

Page 15: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML17

User-Roled & System-Roled:XML DTDs/Schemas

Single (system-level) metarole _slot is employed here

with different (user-level) values of XML attribute name

XML DTDs/Schemas of RuleML only require smallchange to introduce rKR for RuleML's atomic formulas

• The correct interpretation of the three arguments is no longer position-dependent

• Additional arguments such as expiry and region can be added without affecting any existing interpretation

Page 16: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML18

Variables & Rules: Example in POSLVariables are prefixed by a ''?'' (anonymous: just a ''?'' );Permit representation of rules for both pKR and rKR

As an example, here is an rKR version of a discount rule:

discount(offer name->?off; customer name->?cust; awarded amount->10) :-offer(name->?off; category->special; price->?),customer(name->?cust; status->gold).

Using the facts

offer(name->Ecobile; category->special; price->20000).customer(name->Peter Miller; status->gold).

this rule derives, for an Ecobile purchase by Peter Miller,a 10% discount

Page 17: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML19

Variables & Rules: Example in OO RuleMLVariables in OO RuleML use var type tags:<imp> <_rlab><ind>rKR rule 1</ind></_rlab> <_head> <atom> <_opr><rel>discount</rel></_opr>

<_slot name="offer name"><var>off</var></_slot> <_slot name="customer name"><var>cust</var></_slot> <_slot name="awarded amount"><ind>10</ind></_slot> </atom> </_head> <_body> <and> <atom> <_opr><rel>offer</rel></_opr> <_slot name="name"><var>off</var></_slot>

<_slot name="category"><ind>special</ind></_slot> <_slot name="price"><var/></_slot> </atom> <atom> <_opr><rel>customer</rel></_opr> <_slot name="name"><var>cust</var></_slot> <_slot name="status"><ind>gold</ind></_slot> </atom> </and> </_body></imp>

Page 18: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML20

rKR Semantics – Issues

How should we extend pKR's (here, LPs) notions of

• clause instantiation and• ground equality

(for the model-theoretic semantics)

as well as

• unification

(for the proof-theoretic semantics)

?

Page 19: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML21

rKR Semantics – Approach Since rKR role names are assumed here to be non-variable

symbols, rKR instantiation recursively walks through the fillers of user-level roles, substituting dereferenced values from the substitution (environment) for any variables encountered

Since OO RuleML uses explicit rest variables,rKR ground equality recursively compares two clauses after lexicographic sorting of the role-filler slots of atoms and complex term

Since OO RuleML uses at most one rest variable per atom or complex term, rKR unification performs sorting as in the above ground equality, uses the above rKR instantiation of variables, and otherwise proceeds left-to-right as for pKR unification, pairing up identical roles before recursively unifying their fillers

Page 20: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML22

rKR Implementations

Has been completed both via

– an XSLT translator to positional RuleML

and

– an extension of the Java-based jDREW

Available via http://www.ruleml.org/indoo

Page 21: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML23

Next in the Talk

Object Centering via User-Level Roles

URI Grounding of Clauses

Term Typing via Order-Sorted Taxonomies

Page 22: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML24

Object Identifiers for URI-Grounded KR Our previous rKR clauses did not use OIDs for providing each

object with an (object) identity RDF has introduced a new flavor of OIDs to describe

resources via their URIs This style of KR, here called URI-grounded KR (gKR), is also

possible in OO RuleML by permitting a wid (web id)

attribute within the ind type of an _rlab (rule label)or – not further detailed here – of an entire_rbaselab (rulebase label)

Complemented by a widref (web id reference) attribute within the ind type of a referring slot filler

wid and widref are dual like XML's id and idref and RDF's about and resource

Page 23: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML25

Example in OO RuleML<ruleml:rulebase xmlns:ruleml="http://www.ruleml.org/dtd/0.83/ruleml-oodatalog.dtd" xmlns:s="http://offercore.org/offerproperties#" xmlns:t="http://productcore.org/productproperties#"> <fact> <_rlab><ind wid="http://catalist.ca/37">grKR fact 1</ind></_rlab> <_head> <atom> <_opr><rel>offer</rel></_opr> <_slot name="s:name"><ind widref="http://ecobile.com">Ecobile</ind></_slot> <_slot name="s:category"><ind>special</ind></_slot> <_slot name="s:price"><ind>20000</ind></_slot> </atom> </_head> </fact> <fact> <_rlab><ind wid="http://ecobile.com">grKR fact 3</ind></_rlab> <_head> <atom> <_opr><rel>product</rel></_opr> <_slot name="t:name"><ind">Ecobile SX</ind></_slot> <_slot name="t:fuel"><ind href="http://naturalgas.org">gas</ind></_slot> <_slot name="t:horsepower"><ind>90</ind></_slot> <_slot name="t:displacement"><ind>1550</ind></_slot> </atom> </_head> </fact></ruleml:rulebase>

Page 24: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML26

Explanation Previous rKR fact 1 URI-grounded so that it is specialized to

grKR fact 1 for the Ecobile occurring as offer 37 in a certain catalog. Similarly, the ind type of Ecobile has a widref to

another grounded rKR fact, fact 3 This grKR fact 3 uses different kind of URI attribute within an ind:

href refers to 'home page' characterizing the individual (e.g., gas). widref asumes that description about the URI exist, not that the URI (currently) exist; href presupposes that the URI (currently) exist, not that a description about the URI exist

Global user roles can be constructed as QNames whose qualifier is a namespace prefix, e.g. s or t, which is associated with a URI in namespace declaration of rulebase type that surrounds all RuleML clauses. Fragments (''#'') point into the URI-addressed document

Page 25: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML27

RDF Counterpart The OO RuleML facts – except for their optional labels (e.g., grKR fact 1), their explicit relation names (e.g., offer), and their both named and groundedarguments (e.g., Ecobile on http://ecobile.com) – correspond to RDF descriptions, as follows:<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:s="http://offercore.org/offerproperties#" xmlns:t="http://productcore.org/productproperties#"> <rdf:Description about="http://catalist.ca/37"> <s:name rdf:resource="http://ecobile.com"/> <s:category>special</s:category> <s:price>20000</s:price> </rdf:Description> <rdf:Description about="http://ecobile.com"> <t:name>Ecobile SX</t:name> <t:fuel>gas</t:fuel> <t:horsepower>90</t:horsepower> <t:displacement>1550</t:displacement> </rdf:Description></rdf:RDF>

Page 26: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML28

Comparing RDF and OO RuleML RDF's domain-specific properties, e.g. s:name,

s:category, and s:price, are used as XML elements, so

RDF serializations cannot be given a generic

DTD/Schema; OO RuleML's congruent metarole _slot contains the domain-specific roles only as XML attribute

values, so is amenable to a generic DTD/Schema For (ground) facts, OO RuleML representations contain

little more information than their RDF counterparts: RDF diagrams can be regarded as the minimal basic data model; OO RuleML could thus act as an alternate RDF serialization amenable to DTD/Schema validation, hence to embedding into other valid XML (including XHTML) documents

Once RDF facts are captured in OO RuleML, RDF rules (and queries) over them are directly available as well: they can be taken from OO RuleML's system of sublanguages

Page 27: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML30

gKR Semantics – Part 1a

URI strings in the Web processed by rules for expansion,redirection, etc. (by a ''canonicalization algorithm'')before their referenced 'Web objects' (e.g., Web documents)can be retrieved or they turn out to be 'broken links'

Check for semantic URI equality using string rewriting.Two URIs, perhaps syntactically different, semantically equaliff they are rewritten to the same (normal form) URI just beforeboth link to the same Web object or to a broken link error

A URI normal form is a URI string that cannot be rewrittenany further but either directly refers to a Web object or directlyleads to a broken link error

Page 28: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML31

gKR Semantics – Part 1b

For a gKR rulebase B we consider – at any given time t – a

URI rewriting system (s(B), R) over the finite set s(B) ofURIs used for the grounding of B

The rewriting relation R contains URI expansion rules suchas for extending certain URIs by "/", "index.html", etc.also redirection rules for replacing entire URIs by other URIs

For the grounding semantics the URI rewriting system must

be convergent (terminating and confluent), i.e. uniquenormal forms must exist. Testing syntactic equality of thesenormal forms can then be used to check for semantic equality ofany pair of URIs used in grounding

Page 29: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML32

gKR Semantics – Part 2wid attribute within the _rlab of clauses or within the_rbaselab of rulebases semantically labels these elementswith the normal form of the URI string of the attribute's value

widref attributes in a clause semantically initiategraph search for the clause closure in the current document:

Retrieve the clause or rulebase having the same widnormal form label as exhibited by a widref attribute'svalue; recursively continue retrieval with all the widrefattributes of all the clauses retrieved directly or withinrulebases – just ignoring duplicates resulting from circularreferences – until a fixpoint is reached

The URI grounding semantics of the original widref-attributedclause then is the clause closure of all these retrieval results. TheURI grounding semantics of a rulebase is the union of the clauseclosures of all its clauses

Page 30: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML33

gKR Semantics – Part 3

href attribute inside clause semantically – at any given time t –makes the normal form of the attribute's URI value link to thesemantics of the Web object or, for a broken link, causes itto denote an error object.

If the Web object linked to is another gKR rulebase, its semanticscan be obtained as described in the current section; similarly,for the semantics of the previous and next sections; furtherSemantic Web objects (e.g., in OWL) could be covered as well

Page 31: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML34

Next in the Talk

Object Centering via User-Level Roles

URI Grounding of Clauses

Term Typing via Order-Sorted Taxonomies

Page 32: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML35

Web-Sorted KR

Terms, in particular variables, in the previous pKR/rKR and gKR clauses are still untyped using unsorted KR.Here: order-sorted KR (sKR) that is based on special treatment of sort predicates and sorted individuals, variables, etc. in clauses

With sort restrictions directly attached to variables,hence usable during unification, proofs can be kept at more abstract level, thus reducing the search space

An independently defined sort hierarchy, e.g. in RDFS (using subClassOf) or OWL, can be employed as taxonomy that constitutes partial order of the resulting order-sorted logic

Developed a webized construct for linking RuleML variables to such externally defined sort hierarchies of Semantic Web

Page 33: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML36

How Sorted RuleML Variables Link to RDFS classes

Basically, the class hierarchy of an order-sorted logic – e.g. in RDFS – can be accessed from RuleML in a similar way as it can from RDF

RDF's use of rdf:type for taxonomic RDFS typing of individuals/resources is transferred to

RuleML's typing of individuals Additionally, we propose a new RDFS use:

to access unchanged RDFS for RuleML's typing

of variables, noting that the RDFS taxonomy must then be cycle-free (and, if we use an OWL taxonomy, it must also be consistent)

Page 34: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML37

Technical Construct:Fragment identifiers

The technical construct is based on namespace declarationsusing fragment identifiers (''#'') to point into the RDFSdocument containing the class definition to be used as a type

This #class is assumed to exist there, usually with one (or more)subClassOf relations defining (multiple) inheritance

An ind or var is then typed via a type attributeaugmenting the namespace prefix by the class name

Page 35: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML38

Example: Typed Rule HeadOur earlier rKR rule 1 can thus be typed as follows(with class Offer and class Customer):<ruleml:rulebase xmlns:ruleml="http://www.ruleml.org/dtd/0.83/ruleml-oodatalog.dtd" xmlns:t="http://distribcore.org/distribclasses#" xmlns:u="http://customercore.org/custclasses#"> <imp> <_rlab><ind>rsKR rule 1</ind></_rlab> <_head> <atom> <_opr><rel>discount</rel></_opr> <_slot name="offer name"><var type="t:Offer">off</var></_slot> <_slot name="customer name"> <var type="u:Customer">cust</var></_slot> <_slot name="awarded amount"><ind>10</ind></_slot> </atom> </_head> . . . </imp></ruleml:rulebase>

Page 36: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML39

Example: Sort HierarchyHere we assume that the URIhttp://distribcore.org/distribclasseslinks to an RDFS document containing a definition of Offer,e.g. specifying it as a subclass of Distribution

Similarly, for the URIhttp://customercore.org/custclasses

Sorted unification of two typed variables can then employRDFS sort hierarchy to find the greatest lower bound (glb)of their types, failing if it does not exist

Suppose Sale is defined as a subclass of bothOffer and Promotion,another subclass of Distribution

Page 37: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML40

Example: Sorted Unification Based on this hierarchy, the OO RuleML query<ruleml:query xmlns:ruleml="http://www.ruleml.org/dtd/0.83/ruleml-oodatalog.dtd" xmlns:v="http://distribcore.org/distribclasses#"> <_rlab><ind>rKR query 1</ind></_rlab> <_body> <atom> <_opr><rel>discount</rel></_opr> <_slot name="offer name"><var type="v:Promotion">prom</var></_slot> <_slot name="customer name"><ind>Peter Miller</ind></_slot> <_slot name="awarded amount"><var>Rebate</var></_slot> </atom> </_body></ruleml:query>

will unify with the earlier rsKR rule 1 head by binding<var type="v:Sale">prom</var> to <var type="t:Sale">off</var>,

where Sale is found via RDFS as the glb of Offer and Promotion,and also binding<var type="u:Customer">cust</var> to <ind>Peter Miller</ind>and <var>Rebate</var> to <ind>10</ind>

Page 38: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML41

DTDs/Schemas

Only require the following change for sKR:

the introduction of a type attribute on ind, var,

and cterm elements

Page 39: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML42

sKR Semantics

Could be given directly but can also be reduced to unsorted KR,e.g., for sorted terms that are variables:

All occurrences of a sorted variable are replaced by

• their unsorted counterparts plus

• a body-side application of a sort-corresponding unary predicate to that variable (sorted facts thus become unsorted rules)

Moreover, the definition of the unary predicate reflects thesubsumption relations of the sort taxonomy via rules

Page 40: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML43

sKR Implementation

Already been performed directly (without the

above reduction) for various sorted Prolog

pKR systems before the advent of RDFS as

a Web-based taxonomy language

Meanwhile we have adapted sorted indexing

techniques for Prolog to RDFS and to the

Java-based implementation of the Fredericton

OO jDREW interpreter for OO RuleML

Page 41: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML44

Conclusions – OO RuleML Applications

In the RACOFI system OO RuleML rules are utilized in conjunction with collaborative-filtering techniques for querying a database of music objects rated in multiple dimensions

For the Treesim algorithm the role-weightedOO RuleML extension is utilized to represent all product-seaking/advertising trees of the similarity-based AgentMatcher system

OO RuleML has already served asan interchange format in two major applications:

Page 42: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML45

Conclusions –Declarative KR and Object-Orientation Object-Orientation in OO RuleML currently comprises

object-centered user-level roles,object identifiers for URI-grounded clauses, andclass hierarchies over order-sorted terms

A future OO sublanguage could be signature declarations and their instantiation to 'new' clauses. However, this would cross borderline between declarative KR – focused in RuleML – andprocedural KR

OO Rules and OO Programs:clauses that are (ground) facts correspond to instances,signatures can be viewed as classes, andrules may be used for defining methods

Page 43: Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms Harold Boley, NRC IIT e-Business, Fredericton RuleML-2003 Sanibel

OO RuleML46

Conclusions – RuleML Technical Groups Ongoing work on production and reaction rules often uses –

as in Jess – instances/facts stored in the CLIPS format, which employs user-level roles. Moreover, much of the effort in the Reaction Rules TG utilizes object-oriented modeling in the style of OMG's MOF (Integrate’03), whose incorporation has become easier with OO RuleML (similarly for events)

Efforts in the Ontology Combination TG have led, e.g.,to Description Logic Programs, which can be represented employing user-level roles and order-sorted terms. The JC combined OWL & RuleML to Semantic Web Rule Language

The TG on Frames, Objects, and Rule Markup – based mostly on F-Logic and TRIPLE – has started studying rules for RDF and graph-based data, which can be mapped to roled, grounded, and possibly sorted OO RuleML