active xml schemas
play

Active XML Schemas 30/11/2001 Michael Schrefl Martin Bernauer - PDF document

Active XML Schemas 30/11/2001 Michael Schrefl Martin Bernauer Johannes Kepler University Linz Department of Business Informatics Data & Knowledge Engineering A-4040 Linz Austria Europe Altenberger Strae 69 Motivation Web


  1. Active XML Schemas 30/11/2001 Michael Schrefl Martin Bernauer Johannes Kepler University Linz Department of Business Informatics Data & Knowledge Engineering A-4040 Linz – Austria – Europe Altenberger Straße 69 Motivation � Web documents of e-business partners � change dependencies � autonomous, loosely coupled � Content drawn from databases or other documents, some content is in no database � web-based solution for web-only content � ex.: “active document” deletes its out-dated job-ad � Managing content � automatic � asynchronous � potentially according to event history 2 1

  2. Active Behavior of Web-documents � Bonifati/Ceri/Paraboschi: Active Rules for E- Services (VLDB Journal 2001) � apply ECA-paradigm to XML documents � use active rules for pushing reactive services � introduce basic approach based on simple mutation events � Active XML-Schemas: from simple to high-level support for active behavior in XML � based on experience from � conceptual modeling of Business Rules � active object-oriented database design � event-based systems � employ Bonifati’s approach at lower level � for simple mutation events � for implementing event notification 3 Active XML Schemas build on ... � Conceptual modeling of Business Rules � object-oriented representation: Situation/Activation Diagrams (ICDE 1997) � events are first class objects, have an event type, are collected into event classes � calendar events, method events, abstract events, .. � past, current, and future (scheduled) events � logical event classes: provide functionality of complex events, member events determined by querying other event classes � Event-based systems � low coupling � publish/subscribe events 4 2

  3. Objectives and Approach � Extension of XML-Schema � active behavior comes with document schema � provides for reuse and interoperability � easier to design, implement, and maintain � Document-centered � events are “first-class elements” � past, current, and scheduled events can be queried � Distribution � low coupling of documents: event communication � full locality of active rules � Transparency � event source transparency (database vs document, remote vs local) � communication transparency (push vs pull) 5 Extension of XML Schema AcademicJobs.xml Jobs.xsd Act XMLSchema.xsd Static Document Static Doc. Schema Static Document MS Event Classes Event Class Schema Event Class MS Subscribed Documents Import/Export Sch. Import/Export MS Passive Behavior Passive Behavior MS Active Behavior Active Behavior MS Communication Handlers Communication Sch. Communication MS 6 3

  4. act : Namespace defineEventClass defineLogicalEventClass Event Type terminatingEvent Mutation Event Type participatingEvent Insert Element exportEventClass Modify CharData exportEventClassFamily Remove Element scheduleEvent defineProxy Modify Attribute raiseEvent importEventClass invokeOperation importEventClassFamily Calendar Event Type subscription Operation Event Type Abstract Event Type rule suspend ruleTrace Remote Event Type condition unsuspend started action completed aborted ... 7 Export/Import of Event Classes � Schema level Document Type Proxy Definition � define event class Jobs.xsd Faculty.xsd < act:defineEventClass name= 'announce' j:Jobs XSD uni:Faculty XSD evtCategory= 'OperationEvt' E announce (j:Jobs) jobSite � � jobSite.announce memberType= 'j:ExecAnnounce' .../> O announce(j:JobAd) � export event class Import Event Class definition Operations Exported Event Class Defined Event Class < act:exportEventClass name= 'announce'/> � define document proxy with document type < act:defineProxy name= 'jobSite' forDocType= 'j:Jobs'/> import event class definition � < act:importEventClass proxy= 'jobSite' eventClass= 'announce'/> 8 4

  5. Export/Import of Event Classes � Instance level bind proxy � < act:subscription proxy= 'jobSite' > Jobs.xsd Faculty.xsd < act:remoteDoc > academicJobs.xml< /> j:Jobs XSD uni:Faculty XSD < /act:subscription> (j:Jobs) jobSite announce � � jobSite.announce � materialize event class O announce(j:JobAd) < act:eventClass name= 'jobSite.announce'> < act:event id= 'e171' status= 'processed' ... > < act:remoteEvent evtCategory= 'OperationEvt'> Bound Proxy < act:params> academicJobs.xml science.xml < j:job id= 'j2001-11-19_351'> < j:field> CS< /field> j:Jobs XML uni:Faculty XML < j:title> Application Engineer< /> announce jobSite= � � < j:appDeadline> 2001-12-10< /> ... 'academicJobs.xml' < /> jobSite.announce < /> < /> Materialized Event Class < act:event id= 'e172' status= 'occurred' ... > ... < /> < /> 9 Rules � Defined at schema level Jobs.xsd Faculty.xsd j:Jobs XSD uni:Faculty XSD � All components local (j:Jobs) jobSite announce � � jobSite.announce � for communication: O announce(j:JobAd) E postJob export and import events O postJob(j:Job) R ON jobSite.announce I F field= 'CS' or 'EE' < act:rule on= 'jobSite.announce' DO post job on name= 'announceJobRule'> web page Rule < act:condition > < xsl:value-of select= "$e//j:job[j:field= 'CS' or j:field= 'EE']"/> < /> < act:action > < act:invokeOperation > postJob($c)< /> academicJobs.xml science.xml < /> j:Jobs XML uni:Faculty XML < /> announce jobSite= � � "academicJobs.xml" $e .. bound event, $c .. bound condition result jobsite.announce 10 5

  6. Scheduling Events � Rules may schedule Jobs.xsd Faculty.xsd j:Jobs XSD uni:Faculty XSD future events (may be (j:Jobs) jobSite announce � � modified later like jobSite.announce O announce(j:JobAd) calendar entries) E postJob jobAdExpired � Ex.: schedule removal of O postJob(j:Job) unpost(xs:string) posting when job add is R ON postJob posted DO schedule removal in jobAdExpired ... < act:defineEventClass name= 'jobAdExpired' .../> < act:rule on= "postJob" ...> < act:action> < act:scheduleEvent in= 'jobAdExpired'> < act:event occTime= '{ $e//j:appDeadline} '> academicJobs.xml science.xml < uni:expJob id= '{ $e//j:job/@id} '/> j:Jobs XML uni:Faculty XML ...< /> announce jobSite= � � "academicJobs.xml" < act:rule on= 'jobAdExpired' ...> jobsite.announce < act:action> < act:invokeOperation> unpost({ $e/uni:expJob/@id} ) ...< /> 11 Event Class Families Department.xsd Faculty.xsd � Several related uni:Dept XSD uni:Faculty XSD documents export same (uni:Dept* ) depts published � � type of event class depts.published O published O modifyPubStatistics (uni:Paper) � Collected into event (uni:Publication) class family R ON depts.published I F is journal paper � Referenced by set proxy DO modify publi- cation statistics � Member qualifiers used to select specific event compSci.xml science.xml class uni:Dept XML uni:Faculty XML published depts[cs]= � Unqualified reference � "compSci.xml" � returns union ee.xml depts[ee]= "ee.xml" depts[is]= "is.xml" uni:Dept XML depts[* ] published � is.xml uni:Dept XML published � 12 6

  7. Event Class Families faculty.xsd science.xml < act:defineSetProxy name= 'depts' < activeDocument> forDocType= 'uni:Dept'/> < staticDocument> < act:importEventClassFamily < uni:faculty> proxy= 'depts' < uni:name> Science< /> ... eventClass= 'published'/> < /> < /> < act:subscription proxy= 'depts'> < act:remoteDoc qual= 'cs'> compSci.xml< /> < act:remoteDoc qual= 'ee'> ee.xml< /> < act:remoteDoc qual= 'is'> is.xml< /> < /> < act:eventClasses > < act:rule on= 'depts.published' < act:eventClass name= 'depts.published' name= 'modifyPubStatRule'> qual= 'cs'> < act:condition > < act:event id= 'e745' status= 'occured' ...> < xsl:value-of select= "$e//uni:publication < act:remoteEvent> [@type= 'journal']"/> < act:params> < /> < uni:publication> ...< /> ... < act:action > < /> < /> < act:invokeOperation> < act:eventClass name= 'depts.published' modifyPubStatistics($c)< /> qual= 'ee'> ...< /> < /> < /> < /> < /> 13 Multiple time stamps, rule trace � May deliver events ahead of occurrence time (scheduled time) � e.g. salary deposit � Deadline: post mark or delivered ? � posted time � delivered time � Event status: scheduled/occurred/processed � For each event, rule trace for each triggered rule: started, aborted/processed � Time stamps, status, rule trace can be queried in logical event class definitions and rules 14 7

Recommend


More recommend