Extending an OWL Web Node with Reactive Behavior Wolfgang May 1 - - PowerPoint PPT Presentation

extending an owl web node with reactive behavior
SMART_READER_LITE
LIVE PREVIEW

Extending an OWL Web Node with Reactive Behavior Wolfgang May 1 - - PowerPoint PPT Presentation

Extending an OWL Web Node with Reactive Behavior Wolfgang May 1 Franz Schenk 1 Elke von Lienen 2 Institut f ur Informatik, Universit at G ottingen, Germany Institut f ur Informatik, TU Clausthal, Germany PPSWR 2006, Budva,


slide-1
SLIDE 1

Extending an OWL Web Node with Reactive Behavior Wolfgang May1 Franz Schenk1 Elke von Lienen2

Institut f¨ ur Informatik, Universit¨ at G¨

  • ttingen, Germany

Institut f¨ ur Informatik, TU Clausthal, Germany PPSWR 2006, Budva, Montenegro, June 10/11, 2006

slide-2
SLIDE 2

Structure of the Talk

Motivation What are triggers and what are they good for in the Semantic Web? Differences between events and actions Triggers in OWL: simple reactivity reasoning + more reactivity reactive behavior on the semantic level Implementation Conclusion

PPSWR 06 2

slide-3
SLIDE 3

Motivation

Use as much existing solutions as possible (be-lazy-approach). Extend an information-serving RDF web node with reactive behaviour. Integrate this web node into an event-driven semantic web architecture. Apply existing work on active rules (from Active Databases) to Semantic Web Application. Use existing implementations for reasoning about and handling of rdf/owl-data

PPSWR 06 3

slide-4
SLIDE 4

Triggers

Simple kind of Active Rules following a simple Event-Condition-Action Pattern: ON event WHEN condition DO BEGIN action END SQL Triggers Example: ON UPDATE OF actual schedule WHEN $NEW.arrival > $OLD.arrival + 30 DO BEGIN ... END event is an event in the database immediately caused by and identical with an update action

PPSWR 06 4

slide-5
SLIDE 5

Applications/Use of Triggers

Tasks of triggers: Local behavior of a node consistency maintenance wrt. data model (SQL: e.g. referential integrity after a deletion) consistency preservation wrt. application semantics, logging, monitoring Global In an Event-Driven Semantic Web Architecture raise (=derive) application-level events and make them visible to the outside

PPSWR 06 5

slide-6
SLIDE 6

Behavior in the Semantic Web

Domain languages also describe behavior Application-Domain Ontology Domain Ontology Events Actions RDF/OWL Data Model Literals RDF, OWL Level Events RDF, OWL Level Actions

ECA Business Rules Derivation Mapping Triggers actions+OWL reasoning ❀ events

triggers needed for derivation of application-level events triggering OWL-level actions

PPSWR 06 6

slide-7
SLIDE 7

Updates on the RDF Level

... similar to SQL, under consideration of triple and resource semantics: insert a statement delete a statement update a statement (object, predicate, subject) delete a resource (and all statements referring to it) similar to SQL: events == update actions. RDFS/OWL then adds inference to actions ...

PPSWR 06 7

slide-8
SLIDE 8

Update Operations on OWL Data

Events on the OWL-Level can be derived events, that result from some (syntactically different) update operation. There is no distinction between base and derived relations, ⇒ Redundancy is possible Additional update operations:

RETRACT(statement): intensional update, implemented by

delete+triggers; it is considered to be executed successfully, if statement does not hold after update

ASSERT(statement): intensional update; if a statement already

holds, nothing has to be done .

PPSWR 06 8

slide-9
SLIDE 9

Example (I)

facts: (hasHusband, inverseOf, hasWife), (Alice, hasHusband, Bob), (Dan, hasWife, Carol), (Emmy, hasHusband, Frank), (Frank, hasWife, Emmy). derived: (Bob, hasWife, Alice), (Carol, hasHusband, Dan). DELETE(Emmy, hasHusband, Frank) no effect! requires a trigger ON DELETE OF hasHusband DO BEGIN DELETE (OLD:object, hasWife, OLD:subject) END for supporting an intensional update ⇒ reacts upon the action

PPSWR 06 9

slide-10
SLIDE 10

Example (II)

facts: (hasPresident, rdf:type, owl:FunctionalProperty), (Atlantis, hasPresident, JohnDoe). INSERT (Atlantis, hasPresident, ScottTiger) (having also the fact (ScottTiger differentFrom JohnDoe)) model is inconsistent requires a trigger ON INSERT OF hasPresident WHERE {?c hasPresident ?x.} AND ?c = NEW.subject AND ?x <> NEW.object DO BEGIN DELETE (?c, hasPresident, ?x) END for supporting the update before reasoning ⇒ reacts upon the action

PPSWR 06 10

slide-11
SLIDE 11

Example (III)

Mapping Events on the OWL level to the application domain if a statement (dept, hasProfessor, prof) is added to the model, then raise an external event: ON INSERTION OF hasEmployee OF department RAISE EVENT (new employee($object, $subject, $university)) ⇒ reacts upon a change in the model (i.e., a fact that did not hold before now holds) independent which actual update caused this uses additional knowledge added by the reasoner ⇒ after reasoning

PPSWR 06 11

slide-12
SLIDE 12

Solution

⇒ distinguish between actions and events=changes pre-reasoning triggers supporting updates, reacting on intensional update operations, post-reasoning triggers reacting on actual changes.

PPSWR 06 12

slide-13
SLIDE 13

Pre-Reasoning Triggers

React on actions, support for intensional updates ON {INSERT|UPDATE|RETRACT} OF property OF INSTANCE [OF class] INSTEAD OF {ASSERT|UPDATE} OF property OF INSTANCE [OF class] can be used for specifying how to execute an ASSERT or UPDATE instead of straightforwardly materializing the

  • peration.

remove inverse, care for cardinalities etc.

PPSWR 06 13

slide-14
SLIDE 14

Post-Reasoning Triggers

react on actual changes of the model (including derived knowledge) ON {INSERTION|MODIFICATION|DELETION} OF property OF INSTANCE [OF class] ON {CREATION|MODIFICATION|DELETION} OF INSTANCE OF class ON NEW PROPERTY OF INSTANCE [OF class] ON NEW STATEMENT ABOUT INSTANCE [OF class] ON NEW CLASS ON NEW PROPERTY [OF class]

PPSWR 06 14

slide-15
SLIDE 15

A complete trigger example

CREATE TRIGGER test ON INSERT OF hasPresident OF INSTANCE OF country WHEN SELECT $pres WHERE { $new.subject $new.property $pres . } DO BEGIN delete($new.subject, $new.property, $pres); END;

PPSWR 06 15

slide-16
SLIDE 16

Architecture of the Application Node

users,

  • thers

event broker Jena-based main module with Active Functionality PostgreSQL Database: RDF facts DIG tell& ask interface DL Reasoner (e.g. Pellet)

materialized base facts facts queries model answers event occurrences queries, updates answers

PPSWR 06 16

slide-17
SLIDE 17

Algorithm

Work on main model, keep a copy for potential rollback Execute original update and direct triggers on main model iff all direct triggers succeed and the main model is still consistent: proceed;

  • therwise rollback and return

compute the differences between the models before and after updates+triggers ⇒ Set of inserted /deleted statements Evaluate all inserted, deleted and updated facts and fire indirect triggers (including raising of events)

PPSWR 06 17

slide-18
SLIDE 18

Analysis

Model operations make use only of functionality provided by the Jena RDF-Framework computes the whole model and exports it twice, computes two differences, iterates over them drawback: even if no trigger will fire, these differences are computed. but: differences usually small, actual firing of triggers efficient

PPSWR 06 18

slide-19
SLIDE 19

Alternatives

reasoning about updates which actual changes will be the result: requires simulating OWL reasoning , actually the view maintenance problem (view = tuples relevant for the triggering events). comparison only of these materialized views (materialize before vs. after only for the views): derive (SPARQL) view query from trigger declaration, answer SPARQL queries twice (before/after) ∀ triggers, views are in general large, for a large number of triggers less efficient than the complete difference,

  • ptimization: query rewriting/query containment.
slide-20
SLIDE 20

Conclusion

Simple solution. Usage of active rules following the ECA-Paradigm. Ready-to-use implementation, easy to integrate as a webservice. Future work may include different approaches for trigger activation.

PPSWR 06 20

slide-21
SLIDE 21

The end.

PPSWR 06 21