rdftl: an event-condition-action language for rdf
DESCRIPTION
RDFTL: An Event-Condition-Action Language for RDF. George Papamarkos Alexandra Poulovassilis Peter T. Wood School of Computer Science and Information Systems Birkbeck University of London. Introduction. RDF is one of the technologies emerging to realise the vision of the Semantic Web - PowerPoint PPT PresentationTRANSCRIPT
RDFTL: An Event-RDFTL: An Event-Condition-Action Condition-Action
Language for RDFLanguage for RDFGeorge PapamarkosGeorge Papamarkos
Alexandra PoulovassilisAlexandra PoulovassilisPeter T. WoodPeter T. Wood
School of Computer Science and School of Computer Science and Information SystemsInformation Systems
Birkbeck University of LondonBirkbeck University of London
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 22
IntroductionIntroduction RDF is one of the technologies emerging to RDF is one of the technologies emerging to
realise the vision of the Semantic Webrealise the vision of the Semantic Web The use of RDF in dynamic applications that The use of RDF in dynamic applications that
require timely notification of metadata require timely notification of metadata changes raises the need for mechanisms for changes raises the need for mechanisms for monitoring and reacting to such changesmonitoring and reacting to such changes
Event-Condition-Action Rules are a natural Event-Condition-Action Rules are a natural candidate to fulfill these needscandidate to fulfill these needs
This paper presents a language for defining This paper presents a language for defining ECA rules on RDF repositories, focusing on ECA rules on RDF repositories, focusing on syntax, semantics, and an implementation syntax, semantics, and an implementation architecture for centralised and distributed architecture for centralised and distributed environmentsenvironments
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 33
IntroductionIntroduction This work has been largely motivated by This work has been largely motivated by
our work on the SeLeNe project our work on the SeLeNe project (www.dcs.bbk.ac.uk/selene/)(www.dcs.bbk.ac.uk/selene/)
Its goal is to investigate techniques for Its goal is to investigate techniques for managing evolving RDF repositories of managing evolving RDF repositories of educational metadata, and providing a educational metadata, and providing a syndication and personalisation services syndication and personalisation services over such repositoriesover such repositories
Peers in a SeLeNe (self e-learning network) Peers in a SeLeNe (self e-learning network) store RDF/S descriptions relating to store RDF/S descriptions relating to learning objects (LOs) registered with the learning objects (LOs) registered with the SeLeNe and also relating to users of the SeLeNe and also relating to users of the SeLeNeSeLeNe
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 44
IntroductionIntroduction A SeLeNe may be deployed in a centralised or A SeLeNe may be deployed in a centralised or
distributed environmentdistributed environment In a centralised environment one `peer’ server In a centralised environment one `peer’ server
manages all RDF/S descriptions; inmanages all RDF/S descriptions; in a a distributed environment each peer manages distributed environment each peer manages some fragmentsome fragment
SeLeNe’s reactive functionality, to be provided SeLeNe’s reactive functionality, to be provided by ECA rules, includes:by ECA rules, includes: automatic notification to users of the registration of automatic notification to users of the registration of
new LOs of interest to themnew LOs of interest to them automatic notification to users of changes in the automatic notification to users of changes in the
description of LOs of interest to themdescription of LOs of interest to them automatic propagation of changes in the description automatic propagation of changes in the description
of one resource to other, related, resourcesof one resource to other, related, resources
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 55
The RDFTL LanguageThe RDFTL Language Event PartEvent Part
(INSERT | DELETE) e(INSERT | DELETE) e where where ee is a path is a path expression that evaluates to a set of nodes. expression that evaluates to a set of nodes. The rule is triggered if this set of nodes The rule is triggered if this set of nodes contains a new/deleted node. The variable contains a new/deleted node. The variable $delta$delta has as its set of instantiations the has as its set of instantiations the new/deleted nodesnew/deleted nodes
(INSERT | DELETE |UPDATE) triple (INSERT | DELETE |UPDATE) triple The rule The rule is triggered if an arc matching is triggered if an arc matching tripletriple is is inserted, deleted or updated. The variable inserted, deleted or updated. The variable $delta$delta has as its set of instantiations the source has as its set of instantiations the source nodes of arcs that have triggered the rulenodes of arcs that have triggered the rule
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 66
The RDFTL LanguageThe RDFTL Language Condition PartCondition Part
Consists of conjunctions, disjunctions and Consists of conjunctions, disjunctions and negations of path expressions, which may negations of path expressions, which may reference the $delta variable. The rule reference the $delta variable. The rule fires if this expression evaluates to true.fires if this expression evaluates to true.
Actions Actions (INSERT | DELETE) e (INSERT | DELETE) e Inserts/deletes Inserts/deletes
resource(s) specified by resource(s) specified by ee(INSERT | DELETE | UPDATE) triple (INSERT | DELETE | UPDATE) triple
Inserts/deletes/updates an arc specified by Inserts/deletes/updates an arc specified by triple triple
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 77
Example of LO MetadataExample of LO Metadata
http://www.dcs.bbk.ac.uk/LOs/BK187
Book
dc:type
Data On theWeb
dc:titleComputerScience
dc:subject
rdf:Bag
/Authors/Abiteboul
/Authors/Buneman
/Authors/Suciu
rdf:type
rdf:_1
rdf:_2
rdf:_3
dc:creator
From Relations toSemistructed Data
dc:description
bbk:annotation rdf:Seq
http://www.dcs.bbk.ac.uk/books/AN1289
http://www.dcs.bbk.ac.uk/books/AN1297
rdf:type
rdf:_1
rdf:_2
N.Anderson
2001-12-01
Fantasticbook ...
bbk:reviewer
dc:date
bbk:details
J. Smith
2002-10-02
...
bbk:reviewer
dc:date
bbk:details
Reviewdc:type
Reviewdc:type
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 88
Example of User MetadataExample of User Metadata
http://www.dcs.bbk.ac.uk/users/128
T.S. Eliot
rdf:Bag
rdf:Seq
http://www.dcs.bbk.ac.uk/books/AN1289
http://www.dcs.bbk.ac.uk/books/AN1297
vCard:FN
bbk:interest
bbk:review
rdf:type
rdf:_1
rdf:_2
rdf:type
rdf:_1
rdf:_2
Computer Science
Economics
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 99
Example RDFExample RDFTL ruleTL ruleONON INSERT resource()[target(dc:type)=‘Book’]/ INSERT resource()[target(dc:type)=‘Book’]/
target(bbk:annotation)/target(bbk:annotation)/ element()[target(dc:type)=‘Review’]element()[target(dc:type)=‘Review’] IFIF $delta/source()/source() $delta/source()/source() [target(dc:subject)=‘Computer Science’][target(dc:subject)=‘Computer Science’] DODO LET $reviews = LET $reviews = resource(resource(http://www.dcs.bbk.ac.uk/users/128http://www.dcs.bbk.ac.uk/users/128)/ )/ target(bbk:review) INtarget(bbk:review) IN
INSERT ($reviews, seq++, $delta)INSERT ($reviews, seq++, $delta)
Event Part : Event Part : Checks if a review has been added for a Checks if a review has been added for a bookbookCondition Part : Condition Part : Holds if the subject of the book is CSHolds if the subject of the book is CS
Action Part : Action Part : Inserts a new edge between user 128’s Inserts a new edge between user 128’s reviews collection and the new review.reviews collection and the new review.
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1010
RDFTL DeploymentRDFTL Deployment Deployment of RDFTL may be in a Deployment of RDFTL may be in a
centralised, mediated or P2P environment – centralised, mediated or P2P environment – see the see the paper for a discussion of the first twopaper for a discussion of the first two
In a P2P environment, we assume a In a P2P environment, we assume a super-super-peerpeer architecture where each super-peer architecture where each super-peer server may be coordinating a group of peer server may be coordinating a group of peer servers, as well as itself possibly hosting a servers, as well as itself possibly hosting a fragment of the RDF/S metadatafragment of the RDF/S metadata
At each SP there is an installation of the ECA At each SP there is an installation of the ECA EngineEngine
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1111
RDFTL ImplementationRDFTL Implementation See paper for details of syntax, path query See paper for details of syntax, path query
semantics, and rule execution semanticssemantics, and rule execution semantics An An RDFTL ECA EngineRDFTL ECA Engine provides an active provides an active
wrapper over a passive RDF repository, wrapper over a passive RDF repository, exploiting the query, storage and update exploiting the query, storage and update functionality of the repository (currently functionality of the repository (currently RDFSuite from ICS-FORTH)RDFSuite from ICS-FORTH)
The ECA Engine consists of a rule The ECA Engine consists of a rule interpretor, event detector, condition interpretor, event detector, condition evaluator and action schedulerevaluator and action scheduler
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1212
Registering an ECA ruleRegistering an ECA rule ECA rules are generated by application ECA rules are generated by application
services running at peersservices running at peers When a new rule is generated at a peer, it When a new rule is generated at a peer, it
is sent to the super-peer for storageis sent to the super-peer for storage There, the event/condition/action parts of There, the event/condition/action parts of
the rule are annotated with the local peers the rule are annotated with the local peers that are that are relevantrelevant to the rule to the rule
This is determined by keeping an This is determined by keeping an index index at at each peer and super-peereach peer and super-peer
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1313
Peer/Super Peer IndexesPeer/Super Peer Indexes Each peer maintains an annotated copy of its local Each peer maintains an annotated copy of its local
RDF Schema, with ‘0’ and ‘1’ indicating whether or RDF Schema, with ‘0’ and ‘1’ indicating whether or not a node has data of this type at this peernot a node has data of this type at this peer
This information is also propagated to the peer’s SP This information is also propagated to the peer’s SP where a combined annotated RDF Schema is where a combined annotated RDF Schema is maintained from all peers in this SP’s peer group and maintained from all peers in this SP’s peer group and also the remote SPs with which this SP is connected also the remote SPs with which this SP is connected
Any change of in the annotation of an SP’s schema is Any change of in the annotation of an SP’s schema is propagated to its neighbouring SPs propagated to its neighbouring SPs
Each SP also keeps for each node annotated with a Each SP also keeps for each node annotated with a ‘1’ in its schema a ‘1’ in its schema a resource indexresource index i.e. a list of the i.e. a list of the resources of this type referenced by its peer group resources of this type referenced by its peer group
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1414
Indexing in Peers and Super Indexing in Peers and Super PeersPeers
{1}{1}
{1}
{0}{0}
{1}{0}
{1}
{1}{1}
P1
P2
{SP1}{P4,P5,SP1}
{P4,SP1}
{P5,P4,SP1}{SP1}
SP1
1
Local annotated RDFS
Local annotated RDFS
Combined annotated RDFSCombined annotated RDFS
Peer Resource
P1 r1,r2,r4,r5P2
2 Resource indexResource index
{P2}{P1,P2,SP2}
{P1,P2,SP2}
{P1,SP2}{P1}
SP2
r1’,r2’,r4’
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1515
Registering an ECA rule Registering an ECA rule (cont’d)(cont’d)
An new ECA rule registered at a SP is also An new ECA rule registered at a SP is also sent to all neighbouring SP’s that may be sent to all neighbouring SP’s that may be relevant to it – determined from the SP ID relevant to it – determined from the SP ID annotations on the originating SP’s annotations on the originating SP’s schemaschema
These SPs repeat the process of matching These SPs repeat the process of matching each part of the rule against their schemas each part of the rule against their schemas and storing the rule in their rule base if it and storing the rule in their rule base if it is relevant to any of their peer groupis relevant to any of their peer group
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1616
Maintaining the Rule BasesMaintaining the Rule Bases If a peer changes a schema node If a peer changes a schema node
annotation from `1’ to `0’ this information annotation from `1’ to `0’ this information is propagated to its SPis propagated to its SP
The annotation of each rule in SP’s rule The annotation of each rule in SP’s rule base is updatedbase is updated
If as a result there is a rule which is no If as a result there is a rule which is no longer relevant to this peer group it can be longer relevant to this peer group it can be deactivated in SP’s rule base (not deleted, deactivated in SP’s rule base (not deleted, as it may later become relevant again)as it may later become relevant again)
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1717
Maintaining the Rule BasesMaintaining the Rule Bases If a peer changes a schema node annotation If a peer changes a schema node annotation
from `0’ to `1’ this information is again from `0’ to `1’ this information is again propagated to its SP and each rule in SP’s rule propagated to its SP and each rule in SP’s rule base is again updatedbase is again updated
If the schema at the SP now has a node whose If the schema at the SP now has a node whose annotation has changed from `0’ to `1’ this is annotation has changed from `0’ to `1’ this is notified to the SP’s neighboursnotified to the SP’s neighbours
They send to the SP their ECA rules which are They send to the SP their ECA rules which are relevant to the change. They also recursively relevant to the change. They also recursively request from their neighbours such rules, and request from their neighbours such rules, and propagate such rules back to the SP propagate such rules back to the SP
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1818
Rule triggering and Rule triggering and executionexecution
If an event E occurs at a peer P, this notifies If an event E occurs at a peer P, this notifies its SPits SP
The SP determines if E may trigger a rule The SP determines if E may trigger a rule annotated with P’s IDannotated with P’s ID
If so, it sends P the rule’s event query to If so, it sends P the rule’s event query to evaluate (this may involve distributed evaluate (this may involve distributed query processing)query processing)
If the condition is true, the SP generates the If the condition is true, the SP generates the necessary messages from the actions part necessary messages from the actions part of the rule for distributed action executionof the rule for distributed action execution
1818thth May 2004 May 2004 33rdrd Web Dynamics Workshop Web Dynamics Workshop 1919
Ongoing WorkOngoing Work Developing algorithms for matching rule event, Developing algorithms for matching rule event,
condition and action part with schema indexescondition and action part with schema indexes Defining the message syntax between peers.Defining the message syntax between peers. Defining coordination with query processing Defining coordination with query processing Producing a prototype implementationProducing a prototype implementation Experimantation/evaluation/evolutionExperimantation/evaluation/evolution Transactional aspects of ECA rules in P2P Transactional aspects of ECA rules in P2P
environmentsenvironments