Rules in SW
description
Transcript of Rules in SW
![Page 1: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/1.jpg)
Rules in SW
Semantic Web - Spring 2008
Computer Engineering Department
Sharif University of Technology
![Page 2: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/2.jpg)
Outline Introduction to the rules and their usage in
Web RuleML SWRL
![Page 3: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/3.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/4.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/5.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/6.jpg)
Types Of Expert Systems Neural Networks Blackboard Systems Belief (Bayesian) Networks Case-Based Reasoning Rule-Based Systems
![Page 7: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/7.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/8.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/9.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/10.jpg)
Rules in SW
![Page 11: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/11.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/12.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/13.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/14.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/15.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/16.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/17.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/18.jpg)
Representing as tree
![Page 19: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/19.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/20.jpg)
In tree form
![Page 21: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/21.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/22.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/23.jpg)
OWL extension for rules (SWRL) A recommendation to extend OWL to create a Rule language
![Page 24: Rules in SW](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/24.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/25.jpg)
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](https://reader035.fdocuments.net/reader035/viewer/2022062323/56815b13550346895dc8be16/html5/thumbnails/26.jpg)
The End