Visualizing*Logical*Dependencies*in* SWRL*Rule*Bases*Visualizing*Logical*Dependencies*in*...
Transcript of Visualizing*Logical*Dependencies*in* SWRL*Rule*Bases*Visualizing*Logical*Dependencies*in*...
Visualizing Logical Dependencies in SWRL Rule Bases
Saeed Hassanpour, Mar:n J. O’Connor and Amar K. Das
Stanford Center for Biomedical Informa:cs Research MSOB X215, 251 Campus Drive, Stanford, California, USA.
{saeedhp, mar:n.oconnor, amar.das}@stanford.edu
Overview
• Mo:va:on • Related work • Methods
• Results • Summary
• Future work
Overview
• Mo:va:on • Related work • Methods
• Results • Summary
• Future work
Why Do We Need Methods for Rule Explora:on?
• Increasing use of rules in ontologies • Increasing size of rule bases • Inter-‐rela:onships between rules can be complex
• Lack of tools for rule explora:on
Why is a Rule Base Complex?
What is our Goal?
Finding the underlying logical structures of rule bases and visualizing these structures to help users to explore the rule bases
Example SWRL Rule
Five SWRL rules rela/ng to drug recommenda/ons for hypertensive and diabe/c adult pa/ents
Rule A: Person(?p) ^ hasSystolicBloodPressure(?p, ?sbp) ^ hasDiastolicBloodPressure(?p, ?dbp) ^ swrlb:greaterThan(?sbp, 140) ̂swrlb:greaterThan(?dbp, 90) → hasDiagnosis(?p, Hypertension)
Rule B: Person(?p) ^ hasBloodSugarLevelBeforeMeal(?p, ?bsl) ^ swrlb:greaterThan(?bsl, 126) → hasDiagnosis(?p, Diabetes)
Rule C: hasCondition(?p, Hypertension) ^ hasCondition(?p, Diabetes) ^ → prescribedDrug(?p, ACEInhibitor)
Rule D: Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17) ^ hasInsurance(?p, ?i) → InsuredAdult(?p)
Rule E: InsuredPerson(?p) ^ prescribedDrug(?p, ?d) → CoPayEligible(?p)
Example SWRL Rule
Five SWRL rules rela/ng to drug recommenda/ons for hypertensive and diabe/c adult pa/ents
Rule A: Person(?p) ^ hasSystolicBloodPressure(?p, ?sbp) ^ hasDiastolicBloodPressure(?p, ?dbp) ^ swrlb:greaterThan(?sbp, 140) ̂swrlb:greaterThan(?dbp, 90) → hasDiagnosis(?p, Hypertension)
Rule B: Person(?p) ^ hasBloodSugarLevelBeforeMeal(?p, ?bsl) ^ swrlb:greaterThan(?bsl, 126) → hasDiagnosis(?p, Diabetes)
Rule C: hasCondition(?p, Hypertension) ^ hasCondition(?p, Diabetes) ^ → prescribedDrug(?p, ACEInhibitor)
Rule D: Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17) ^ hasInsurance(?p, ?i) → InsuredAdult(?p)
Rule E: InsuredPerson(?p) ^ prescribedDrug(?p, ?d) → CoPayEligible(?p)
How Do We Do That?
• Finding rule dependencies • Finding logical layers in rules • Finding rule clusters in logical layers
What Do We Do?
A
B C
D
E
What is OWL?
• Ontology Web Language (OWL): goal is to be the language underpinning the Seman:c Web
• Building blocks: classes, proper:es, individuals • Formal descrip:on logic-‐based seman:cs
What is SWRL?
• Seman:c Web Rule Language (SWRL) is intended the de facto standard rule language of the Seman:c Web.
• All rules are expressed in terms of OWL concepts (classes, proper:es, individuals).
• SWRL is based on a high-‐level abstract syntax for Horn-‐like rules.
Challenges: Sources of Poten:al Inter-‐rule Dependencies
• OWL classes: capture classifica:on informa:on about individuals
• OWL object proper:es: relate individuals to each other.
• Inference run-‐:me sources: – data value asser:ons – built-‐in atoms – data range atoms
Overview
• Mo:va:on • Related work • Methods
• Results • Summary
• Future work
Related Work
• SAMOS – An object-‐oriented database management system, provides a graphical
rule editor and browser for managing Event-‐Condi:on-‐Ac:on-‐rules in databases
– No mechanisms for showing the rela:onships or dependencies between rules.
• UML – Visualize some types of dependencies between rules
– Not a full rule representa:on language: incompa:bili:es between rule modeling and the object-‐oriented paradigm of UML
Related Work
• URML – Based Rule Modeling Language (URML) addresses some of UML’s
limita:ons
– The overall approach is focused on represen:ng event triggering and event produc:on rather than displaying the rela:onships between rules themselves.
• Rule Dependency Analysis – These techniques detect anomalies in rule bases
– These approaches have not concentrated on exploring these dependencies to produce visualiza:ons of overall rule base structure
Related Work • Axiomé
– A rule management tool to categorize, visualize, and paraphrase SWRL rules
– Based on the syntac:c structure of the rules and it does not incorporate the semantics of the underlying relationships
Overview
• Mo:va:on • Related work • Methods
• Results • Summary
• Future work
Methods
1. Analyzing dependencies among rules 2. Rule dependency graph genera:on 3. Topological sort 4. Building layers of dependencies 5. Rule clustering 6. Evalua:on
1. Analyzing Dependencies Among Rules
• An analysis of references to the same OWL classes and object proper:es in different rules
• An analysis of the domain and range of object property atoms to determine if any resul:ng object property asser:ons about OWL individuals can produce dependencies.
• Object property atoms matches when their individuals are from: – The same classes
– Sub/Super classes – Equivalent classes
Example SWRL Rule
Five SWRL rules rela/ng to drug recommenda/ons for hypertensive and diabe/c adult pa/ents
Rule A: Person(?p) ^ hasSystolicBloodPressure(?p, ?sbp) ^ hasDiastolicBloodPressure(?p, ?dbp) ^ swrlb:greaterThan(?sbp, 140) ̂swrlb:greaterThan(?dbp, 90) → hasDiagnosis(?p, Hypertension)
Rule B: Person(?p) ^ hasBloodSugarLevelBeforeMeal(?p, ?bsl) ^ swrlb:greaterThan(?bsl, 126) → hasDiagnosis(?p, Diabetes)
Rule C: hasCondition(?p, Hypertension) ^ hasCondition(?p, Diabetes) ^ → prescribedDrug(?p, ACEInhibitor)
Rule D: Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17) ^ hasInsurance(?p, ?i) → InsuredAdult(?p)
Rule E: InsuredPerson(?p) ^ prescribedDrug(?p, ?d) → CoPayEligible(?p)
Example SWRL Rule
Five SWRL rules rela/ng to drug recommenda/ons for hypertensive and diabe/c adult pa/ents
Rule A: Person(?p) ^ hasSystolicBloodPressure(?p, ?sbp) ^ hasDiastolicBloodPressure(?p, ?dbp) ^ swrlb:greaterThan(?sbp, 140) ̂swrlb:greaterThan(?dbp, 90) → hasDiagnosis(?p, Hypertension)
Rule B: Person(?p) ^ hasBloodSugarLevelBeforeMeal(?p, ?bsl) ^ swrlb:greaterThan(?bsl, 126) → hasDiagnosis(?p, Diabetes)
Rule C: hasCondition(?p, Hypertension) ^ hasCondition(?p, Diabetes) ^ → prescribedDrug(?p, ACEInhibitor)
Rule D: Person(?p) ^ hasAge(?p,?age) ^ swrlb:greaterThan(?age,17) ^ hasInsurance(?p, ?i) → InsuredAdult(?p)
Rule E: InsuredPerson(?p) ^ prescribedDrug(?p, ?d) → CoPayEligible(?p)
2. Rule Dependency Graph Genera:on
Rules are presented as a nodes. Edges represent dependencies between them.
A
B C
D
E
3. Topological Sort
The rules are ordered into a sequence where each rule is before all of its dependent rules
4. Building Layers of Dependencies
• Aher sor:ng the rules topologically, the method then aiempts to group the rules into layers based on their dependencies
• To form these layers we use a greedy algorithm that guarantees the minimum number of layers
Building Layers of Dependencies -‐ Algorithm
L ← List of topologically sorted nodes Layers ← Empty list of nodes in each layer
for each node n in L do P is the list of n’s parents if P is empty then add n to Layers(0) else maxLayer ← The largest layer number of nodes in P
add n to Layers(maxLayer+1)
5. Clustering Rules with Similar Dependencies
As a final step aher breaking the rules into dependency layers, our method further clusters the rules within each layer into subgroups of similar rules based on the strength of their dependencies.
Rule Hierarchical Clustering
Clustering stopping threshold
Number of Clusters
• The number of rule clusters is decided by the user
• We provide two heuris:c criteria as sugges:ons to automa:cally decide when to terminate the clustering process: – Find the most stable clustering – Median distance for rules in a layer
6. Evalua:on
To evaluate the usefulness and efficacy of our techniques, we applied our method on two publicly available OWL ontologies containing SWRL rules bases: – Hypertension rule base – Family rela:onship rule base
Overview
• Mo:va:on • Related work • Methods
• Results • Summary
• Future work
Hypertension Rule Base • Medical treatment rules for pa:ents with hypertension or
elevated blood pressure • There are 19 SWRL rules in the rule base
• There are 145 OWL classes and proper:es in pa:ent management ontology
• The ontology and rule base are developed by a separate group and available online1
1 http://www.cs.auckland.ac.nz/~thusitha/aiim09/
Hypertension Rule Base
Family Rule Base
• Encodes family rela:onships • There are 146 rules and defines a set of rela:onships
between people in a family • There are 578 OWL classes and proper:es in the family
history ontology • The ontology and rule base are developed by a separate
group and available online1
1 National Center for Biomedical Ontology BioPortal: www.bioontology.org
Family Rule Base
• Family rela:onships encoding
Overview
• Mo:va:on • Related work • Methods
• Results • Summary
• Future work
Summary
• The increasing size and complexity of rule bases makes tools for rule base explora:on a necessity
• Our methods of seman:c rule analysis and visualiza:on enables summarizing and explora:on large and complex rule bases
Overview
• Mo:va:on • Related work • Methods
• Results • Summary
• Future work
Future Work
• Inves:gate addi:onal graphical techniques that will enhance the display of the logical dependencies between layers and clusters of rules
• Support explana:on and visualiza:on of inference results
Thank You!
Ques:ons?
This project was supported in part by funds from NIH grants 1R01LM009607-01A2 and 1R01MH087756-0109.