26
Rules in SW Semantic Web - Spring 2008 Computer Engineering Department Sharif University of Technology

Rules in SW

  • Upload
    jerry

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

Rules in SW. Semantic Web - Spring 2008 Computer Engineering Department Sharif University of Technology. Outline. Introduction to the rules and their usage in Web RuleML SWRL. Introduction. - PowerPoint PPT Presentation

Citation preview

Page 1: Rules in SW

Rules in SW

Semantic Web - Spring 2008

Computer Engineering Department

Sharif University of Technology

Page 2: Rules in SW

Outline Introduction to the rules and their usage in

Web RuleML SWRL

Page 3: Rules in SW

Introduction Rules as an important aspect of Internet e-business: rule-

based business policies & business processes, for B2B & B2C. represent seller’s offerings of products & services, capabilities,

bids; map offerings from multiple suppliers to common catalog. represent buyer’s requests, interests, bids; → matchmaking. represent sales help, customer help, procurement,

authorization/trust, brokering, workflow. high level of conceptual abstraction; easier for non-

programmers to understand, specify, dynamically modify & merge.

executable but can treat as data, separate from code potentially ubiquitous; already wide: e.g., SQL views, queries.

Rules in communicating applications, e.g., embedded intelligent agents.

Page 4: Rules in SW

Introduction (cont.) Rules are being used for many interconnected

purposes, capturing regularities in application domains such as the following: Engineering: Diagnosis rules Commerce: Business rules (including XML versions such

as the Business Rules Markup Language (BRML) of IBM's Business Rules for Electronic Commerce project)

Law: Legal reasoning (Robert Kowalski and Marek Sergot have been formalizing legal rules in an Imperial College group)

Internet: Access authentication (Tim Berners-Lee proposed registration engines that use authentication rules such as the following: Any person who was some time in the last 2 months an employee of an organization which was some time in the last 2 months a W3C member may register.)

Page 5: Rules in SW

Expert Systems… Are a branch of artificial intelligence. Simulate human reasoning in some

domain. “Reason” by heuristic or approximate

methods. Explain and justify solutions in user-

friendly terms.

Page 6: Rules in SW

Types Of Expert Systems Neural Networks Blackboard Systems Belief (Bayesian) Networks Case-Based Reasoning Rule-Based Systems

Page 7: Rules in SW

Rule-Based Expert Systems Originated from AI research in the 70s and

80s. Problem data stored as facts. “Reason” using IF…THEN…ELSE rules. Can “reason” deductively (forward-

chaining) or inductively (backward-chaining).

Page 8: Rules in SW

When to Use Rule-Based Systems Problem Domain = narrow, well-understood

domain theory Knowledge Representation = facts and rules Output = recommendation Explanation = rule firing trace Learning Ability = generally no (but…)

Page 9: Rules in SW

Inference Process1. Rules and facts compared using pattern

matcher.2. Matched rules activated into a conflict set.3. Conflict set resolved into agenda (process

called conflict resolution).4. Rule engine fires on agenda.5. Engine cycles until all rules are satisfied.

Page 10: Rules in SW

Rules in SW

Page 11: Rules in SW

Example rules The discount for a customer is 5.0 percent

if the customer is premium and the product is regular

A customer is premium if their spending has been min 5000 euro in the previous year

Those who are members of CE can access CE portal

Page 12: Rules in SW

RuleML

Rather than reinventing rule principles and markups in each community, the idea of RuleML is to 'package' the rule aspect of any domains

make it available as an (XML) namespace, .../RuleML,

can be mixed with a namespace for natural-language (XHTML) texts

and possible domain-specific namespaces (much like MathML is mixed into such domain texts).

Page 13: Rules in SW

RuleML initiatives

Dozens of institutions (~35), researchers; esp. in US, EU Mission: Enable semantic exchange of rules/facts

between most commercially important rule systems Standards specification: 1st version 2001; basic now

fairly stable A number of tools (~12 engines, translators, editors),

demo applications Successful Workshop on Rules at ISWC was mostly

about RuleML / LP Has now a “home” (www.ruleml.org) Initial Core: Horn Logic Programs KR …Webized (in

markup)… and with expressive extensions

Page 14: Rules in SW

Type of rules possible in RuleML

Derivation rules Deriving new facts Maybe evaluated bottom-up as in deductive

databases Top-down as in Logic Programming Example: dynamic inclusion of derived facts

in a html response Reaction rules

Also called ECA (Event-Condition-Action) or Triggers

Example: Specification of behavior in response to browser events

Page 15: Rules in SW

RuleML top-level hierarchy Integrity constraints are

considered as "denials" or special reaction rules whose only possible kind of action is to signal inconsistency when certain conditions are fulfilled.

Derivation rules are considered as special reaction rules whose action happens to only add or 'assert' a conclusion when certain conditions (premises) are fulfilled.

Facts are considered as special derivation rules that happen to have an empty (hence, 'true') conjunction of premises.

Page 16: Rules in SW

RuleML toturial Peter Miller's spending has been min

5000 euro in the previous year. <Atom>

<Rel>spending</Rel> <Ind>Peter Miller</Ind> <Ind>min 5000 euro</Ind> <Ind>previous year</Ind>

</Atom>

This is a fact

Page 17: Rules in SW

RuleML toturial (cont.) "spending" is marked up as the relation

name (table name) for the fact. "Peter Miller", "min 5000 euro", and

"previous year" are marked up as individual constants that are the three arguments (table columns) of the relation.

The entire relation application constitutes an atomic formula, marked up by <Atom> ... </Atom>.

Page 18: Rules in SW

Representing as tree

Page 19: Rules in SW

An example rule A customer is premium if their spending has been min 5000

euro in the previous year

<Implies> <head>

<Atom> <Rel>premium</Rel>

<Var>customer</Var> </Atom>

</head> <body>

<Atom> <Rel>spending</Rel>

<Var>customer</Var> <Ind>min 5000 euro</Ind>

<Ind>previous year</Ind> </Atom>

</body> </Implies>

Page 20: Rules in SW

In tree form

Page 21: Rules in SW

What is SWRL? SWRL is an acronym for Semantic Web

Rule Language. SWRL is intended to be the rule language

of the Semantic Web. SWRL includes a high-level abstract syntax

for Horn-like rules. All rules are expressed in terms of OWL

concepts (classes, properties, individuals).

Page 22: Rules in SW

SWRL Characteristics W3C Submission in 2004:

http://www.w3.org/Submission/SWRL/ Based on OWL-DL Has a formal semantics Rules saved as part of ontology Increasing tool support: Bossam, R2ML,

Hoolet, Pellet, KAON2, RacerPro, SWRLTab Can work with reasoners

Page 23: Rules in SW

OWL extension for rules (SWRL) A recommendation to extend OWL to create a Rule language

Page 24: Rules in SW

SWRLTab A Protégé-OWL development environment

for working with SWRL rules Supports editing and execution of rules Extension mechanisms to work with third-

party rule engines Mechanisms for users to define built-in

method libraries Supports querying of ontologies

Page 25: Rules in SW

References RuleML.org http://www.semanticweb.org/SWWS/

program/full/paper20.pdf http://www.cs.man.ac.uk/~horrocks/

DAML/Rules/ http://www.cs.unb.ca/~boley/ruleml/

ruleml-rgs.pdf http://www.w3.org/Submission/SWRL/

Page 26: Rules in SW

The End