P.L. Flavours of XChange, a rule-based reactive language for the (Semantic) Web
更新时间:2023-05-12 17:54:01 阅读量: 实用文档 文档下载
- p.l.是什么意思的缩写推荐度:
- 相关推荐
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
FlavoursofXChange,aRule-BasedReactive
Languageforthe(Semantic)Web
JamesBailey1,Fran¸coisBry2,MichaelEckert2,andPaula-LaviniaP atr anjan21TheUniversityofMelbourne,Australia,http://www.cs.mu.oz.au/~jbailey/
2UniversityofMunich,Germany,http://pms.ifi.lmu.de/
Abstract.ThisarticleintroducesXChange,arule-basedreactivelan-guagefortheWeb.Stressingapplicationscenarios,it rstarguesthathigh-levelreactivelanguagesareneededforbothWebandSemanticWebapplications.Then,itdiscussestechnologiesandparadigmsrelevanttohigh-levelreactivelanguagesforthe(Semantic)Web.Finally,itpresentstheEvent-Condition-ActionrulesofXChange.
1Introduction
AcommonperceptionoftheWebisthatofadistributedrepositoryofhyper-mediadocuments,withclients(ingeneralbrowsers)thatdownloaddocuments,andserversthatstoreandupdatedocuments.Althoughre ectingawidespreaduseoftheWeb,thisperceptionisnotcompletelyaccurate.Infact,manyWebapplicationsrelyontheupdatingofserverdatainresponsetotherequestsofclients,orclientdatainresponsetotherequestsofservers.Indeed,therearemanykindsofreactionsforbothserversandclients,toeventsormessagesex-changedontheWeb.TheWebhasaninfrastructureforupdatesandreactivity:theprotocolHTTP.Thisarticle rstarguesthatcomplementingHTTPwithhigh-levellanguagesforupdatesandreactivityisneededforbothstandardWebandSemanticWebapplications.ItthenintroducesXChange,anovelhigh-levellanguageforEvent-Condition-Actionrulesforupdatesandreactivityonthe(Semantic)Web.
2Motivation
UpdatesontheWeb.ManyWebapplicationsbuilduponserversthatupdatedataaccordingtoclientrequestsoractions.Thisisthecasefore-Commercesystemsthatreceive,processandbuyorders,e-Learningsystemsthatselectanddeliverteachingmaterialsdependingonstudents’testperformances,andofcommunicationplatformssuchaswikis,whereseveralusersmodifythesamedocuments.Conversely,someWebapplicationsalsobuilduponclientsthatup-datedataaccordingtoserverrequests.Thisisthecasewithso-calledcookies,i.e.descriptionsonaclientofthestatesofaconnectiontoaserver,orwhenaclientkeeps,afteraconnectiontoaserver,datacollectedduringtheconnection,e.g.forarailwaysorairlineelectronicticket.
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
2
ReactivityontheWeb.ManyWebapplicationsnotonlybuildupontheupdatingofdata,butalsouponcomplexreactionstomessagesorevents,exchangednotonlybetweenclientsandserversbutalso(viaservers)betweenclients.ThisisthecasewhencontributorstoaWeb-basedcommunicationplatformareinformedofothercontributorsjoininginorleavingasession.ItisthecaseforWeb-basedbusinessmanagementsystems,suchasbusinesstravelapplicationsandplanningandreimbursementinlargecompanies,thatrelyuponcomplexwork owsofactionsandmessages,possiblyrealizedusingWebservices.ItisalsothecaseforWeb-basedsystemso eringcontext-dependentservices.e.g.atimeandlocationdependentcarparkdirectory,thatadaptstheinformationitdeliversandreactstotimechanges,withclientschangingplacesandcarparksannouncingtheirfreeparkingcapacities.
UpdatesandReactivityontheSemanticWeb.Updatesandreactivityareasmuch“SemanticWebissues”,astheyare“standardWebissues”.Theapplicationscenariosstressedabove,mightinvolvebothstandardWebandSemanticWebdataandtechniques,suchasHTML,XML,RDF,TopicMapsandOWLdata,aswellasinferencefromRDFtriples.Forexample,e-Commerceo ersmightbedescribedbyRDFmeta-dataandane-LearningsystemmightrefertoinferencerulesexpressedintermsofRDFtriples,RDFS,andOWL.
HTTP/1.1:TheInfrastructureforUpdatesandReactivityontheWeb.UpdatesandreactivityontheWebarerealizedusingHTTP/1.1,thecurrentversionoftheHypertextTransferProtocol.HTTP’scommunicationparadigmisaclient-servermodelofrequest-responseinteractionso eringamongothers,therequestsGET(bywhichaclientcanretrievefromaserver,informationidenti edbyaURI)andPOST(bywhichaclientcansubmitinformationtoan“entity”onaserveridenti edbyaURI).HTTPhasrolesfor(software)intermediariessuchasproxies,gateways,andtunnels,givingrisetothespeci cationofvariousformsofcommunication.HTTPhastwokindsofmessages:requestsandresponses.Messageheadersgiverisetothespeci cationofnetworkcommunicationandsystemparameters(e.g.whetherthemessagesenderwantstoclosetheconnec-tion),cachingdirectives,encodinginformation(e.g.indicatingthatthemessagebodyisencodedusingthegzip leformat),communicationprotocolsotherthanHTTP/1.1acliento erstheservertouse,thelengthofthemessagebody,abaseforrelativeURIsreferredtoinamessagebody,etc.
High-LevelLanguagesforUpdatesandReactivityontheWeb.AlthoughHTTP/
1.1canhelpimplementupdatesandreactivityontheWeb,asneededbytheafore-mentionedapplications,moreabstractandhigher-levellanguagesareneed-edthat(1)abstractawaynetworkcommunicationandsystemissues,(2)easethespeci cationofcomplexupdatesofWebresources(e.g.XML,RDF,andOWLdata),(3)areconvenientforspecifyingcomplex owsofactionsandreactionsontheWeb.Theneedforhigh-levelWebupdateandreactivitylanguagesissimilartotheneedforhigh-level(Semantic)Webquerylanguages(cf.[2]forasurvey).High-levelreactivitylanguageswillcomplement,notreplaceHTTP.Indeed,thesimplestandthereforemostdesirablewaytoimplementahigh-levelreactivitylanguageforthe(Semantic)Web,istouseHTTP/1.1.
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
3
3TechnologiesandParadigms
AtomicEvents,EventMessages,andCompositeEvents:WebandSemanticWebapplicationsrequireanumberofdi erentkindsofatomicevents:i)eventsex-changedbetweenWebnodes,tomakeitpossibleforaWebnodetotriggerre-actionsatremoteWebnodes,ii)eventslocaltoaWebnode,tohelpexpresslocalreactivity,e.g.localupdates,andiii)systemevents,makingitpossibleforreactiontothefunctioning,ornon-functioning,oftheencompassing“sys-tem(s)”,e.g.theoperatingsystemofanodeorofthenetwork.AsimpleandnaturalassumptionisthateventsexchangedbetweenWebnodesareexpressedaseventmessages,expressedinaWebformatsuchasXML.Reactingtocompos-ite(orcomplex)events,plexeventshavereceivedconsiderableattentioninthe eldofactivedatabases,cf.e.g.[16,14].How-ever,di erencesbetween(generallycentralised)activedatabasesandtheWeb,wherecentralclockandmanagementaremissingandmessagedeliveriesbetweenWebnodescanbedelayed,necessitatenewapproaches.Furthermore,compositeeventsre ectingauser-centered,andnotasystem-centeredviewareneededontheWeb.
EventMessagesvs.WebResources.EventmessagesandstandardWebresourcesshouldbekeptintwoseparatedatakinds,sinceotherwisethedevelopmentofthereactiveWebmaybeinsu cientlydistinguishablefromthe(Semantic)Web.Inshort:NoURIsforeventmessages!
TemporalDependenciesoftenhavetobeexpressedwhencompositeeventsarespeci ed.Anapplicationexamplemightbe“dependonaneventE1occurringbeforeaneventE2”,or“dependonaneventE3occurringwithinatimeinterval”.Thus,areactivelanguagerequiressophisticatedtemporalnotionsandtemporaleventcompositionconstructs.
Event-Condition-ActionRules,(ECArules) twellwiththewidespreadandintuitiveviewoftheWebasadistributedrepositoryofdocumentsmentionedabove.Indeed,ECArulesbuildonqueriesbytheuseof“conditions”.Thus,ECArulesbuildingonaWeborSemanticWebquerylanguageareaverynaturalparadigmforupdatesandreactivityontheWeb.Updatesandreactivitypertaintoimperativeprogramming,becausetheyrefertostatechangesontheWeb.Arguably,ECArulesbuildingonaWebquerylanguagearemoreconvenientforreactivityontheWeb,thanconventionalimperativeprogramminglanguages.DistributedProcessingandCommunication.OntheWeb,reactiveprogramscallfordistributedprocessing.Arguably,reactivelanguagesmakingeachWebnodecapableofcontrollingitsownreactivebehaviour,would tthede-centralisedmanagementofthe(Semantic)Web.
4XChangeinaNutshell
XChangeisalanguageofECArules.Eachruleconsistsofthreeparts:(1)aneventquery,alsocalled“event”,accessing(localorremote)eventmessagesand(local)systemevents,(2)aWebqueryrefereedtoasthe“condition”accessing
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
4
standardWebdata,and(3)an“action”expressing(3.a)singleupdates,(3.b)transactionsi.e.agroupofactionstoberealizedinanall-or-nothingmanner,or(3.c)messagestobesenttoWebnodes.
TheatomiceventsofXChangearehappenings(e.g.anupdateofapossiblyremoteWebresource)towhicheachWebnode(throughareactiveprogram)mayormaynotreact.XChangedistinguishesbetweentwokindsofatomicevents:ex-pliciteventsandimplicitevents.ExpliciteventsareexplicitlyraisedbyauserorbyanXChangeprogramataWebnodeandsenttothisand/orotherWebnodesaseventmessages.XChange’seventmessagesare(arbitrary)XMLdocumentswithinaneventmessageenvelopeexpresseditselfasa(speci c)XMLdocument.Anenvelopementionsatleastthesender,arecipient,and,uponreceptionataWebnode,thereceptiontime.Anenvelope,mightinaddition,mentionotherrecipientsandtheevent’sraisingtime(atthesender’snode).Figure2presentsanenvelopeinthetermsyntaxofXcerpt[5,2,18]andXChange.ThissyntaxisaslightvariationoftheXMLsyntaxwithunlabeledparenthesesinsteadofla-beledtagsandelementnamesoccurringimmediatelybeforetheparentheses,e.g.article[title{"FlavourofXChange"},body[...]]isthetermsyntaxfortheXMLdocumentofFigure1.Figure2presentsanXChangeeventmes-<article>
<title>FlavourofXChange</title><body>...</body>
</article>
Fig.1.
sage(notethenamespacepre xxchange).Therespectivemeaningsofthesquarebrackets[]andcurlybraces{}areexplainedinSection5.Nestingmessageswiththeirformerenvelopesmakeitpossibletotracktheoriginofmessages,removingenvelopesbeforeforwardingmessageshidestheirorigin.
xchange:event{
xchange:sender{"http://www.pms.lmu.de/"},
xchange:recipient{""},
xchange:recipient{"http://www.cs.mu.oz.au/~jbailey/"},
xchange:raising-time{"2005-06-29T18:15:00"},
info{"HereisanarticleforRuleML’06!"],
article[title{"FlavourofXChange"},authors[...],body[...]]}
Fig.2.AnXChangeEventMessage
ImpliciteventsarelocaleventssuchasupdatesoflocalWebresourcesandsystemclockevents.Theyarenotexpressedthrougheventmessages.EventsaretransmittedfromoneWebnodetoanotherviaeventmessages.Thus,positeeventsarede nedinXChangeasanswersofcompositeeventqueries,cf.Section6.
XChangemakesastrictdistinctionbetweenpersistentdata,i.e.Webre-sources,3andvolatiledata,i.e.byde nitionevents.XChangereliesonthequery3AWebresourcemightbecomputedonrequestfromotherresources,usinge.g.views,andthereforebemore“dynamic”than“persistent”.XChange’sdistinctionbetweenWebresourcesandeventsisnota ectedbytheexistenceof“dynamic”resources.
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
5
languageXcerpt[5,2,18]foraccessingpersistent,i.e.Web,data.XChangeusesanovelquerylanguageespeciallytunedtoeventsforaccessingvolatiledata,i.e.events.ThiseventquerylanguagebuildsuponXcerptandextendsitwithconstructsfortemporaleventcomposition.EventmessagescanbeturnedintoWebresources,andWebresourcesmightbeincludedineventmessages.ThemetaphorforXChange’sdistinctionbetween“volatiledata”orevents,versus“persistentdata”orWebresources,isthatofspeechvs.writtentext:Speechcannotbestoredandcannotbeupdatedonceproduced,butonlycompletedbyfurtherspeech,whilstwrittentextcanbestoredandupdated.However,(non-storable,non-updatable)speechcanbeturnedinto(storableandupdatable)writtentext.
XChange’seventqueryevaluationisnotbasedoneventconsumption:aneventalreadyusedinansweringaneventquerycanbeusedforansweringanothereventquery.XChangesupportsalimitedformofeventselection[19]withthetemporalrangesofitseventqueries.Theauthorsbelievethatrejectingeventconsumptionandinsteadusing“pure”eventselection,greatlycontributestomakingtheeventquerylanguageclosertodatabaseandWebquerylanguages,especiallyXcerpt,thusmakingprogramminginXChangeeasier.NotethateventconsumptionandselectionstrategiescaneasilybeimplementedusingXChangerules.
XChange’scommunicationmodelispeer-to-peer,i.e.allWebnodes,whethertheybeclientsorserversaccordingtoHTTP,havethesamecommunicationcapabilitiesandeverypartycaninitiateacommunicationwitheveryotherWebnode.Twobasiccommunicationstrategiesarepossibleonanetwork:apushstrategywheresendersinformrecipientsofmessagestheywanttosendtothem,andapullstrategywhere(potential)recipientskeepqueryingall(potential)sendersformessages.Arguably,thepullstrategyisconvenientforquerying(persistent)Webresources,whilethepushstrategyisconvenientforquerying(volatile)events.XChangereliesonthepushstrategyforeventqueriesandonthepullstrategyforWebresourcequeries.4XChange’smessagecommunicationisasynchronous,i.e.XChange’s‘sendoperation’isnon-blocking:theexecutionofanXChangeprogramimmediatelycontinuesaftera‘sendoperation’withoutwaitingforthemessagetransmission,anacknowledgementofreceipt,orareply.NotethatblockingsendingcaneasilybeimplementedusingXChangerules.
XChangeprogramsareprocessedinadistributedmanner,each(XChange-aware)Webnodeprocesses,possiblybydelegationtoanotherWebnode,theXChangeprogramslocallyspeci ed.XChangereliesneitheron“super-peers”,noroncentralservices,suchasacentralsynchronizationpoint.
XChangeensuresalocalcontrolofevents,aswellasofeventmemorisation.AWebnodemightrejectanupdaterequestfromaremoteWebnode(sentin4Pushcommunicationcanbesimulatedinapullcommunicationframeworkby“con-tinuousqueries”,i.e.potentialrecipientsperiodicallypollingallpotentialsenders.Thissimulationhasseveredrawbacks:Increasednetworktra c,delayedreceptions,communicationinitiatedbypotentialrecipientsandnotactualsenders,potentialrecipientsmustbeawareofallpotentialsenders,etc.
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
6
aneventmessage),e.g.becauseofalackofcredentials.Furthermore,theeventsmemorizedataWebnodeonlydependontheXChangeeventqueriesposedatthatnode.Thetimeduringwhichanatomicevent,e.g.aneventmessageoralocalimplicitevent,iskeptinmemoryataWebnode,onlydependsontheeventqueriesposedatthatnode.Bydesign,XChangecompositeeventqueriescanbeevaluatedwithoutkeepinganyeventforeverinmemory.Ifthisisnecessaryforsomeapplications,(volatile)eventsshouldbeexplicitlystoredas(persistent)Webresources.
XChangeeventquerieshaveadeclarativesemanticsexpressedintermsofaTarski-stylemodeltheory,i.e.recursivelyonthestructureofcompositeeventqueries,makingthemeasytounderstandandtoimplement.XChangeeventqueryevaluationisdata-driven,incomingeventsareusedforincrementallyeval-uatingqueries.Incontrast,theevaluationofqueriesagainstWebresources,e.g.XcerptqueriesandXChangeconditions,isingeneralquerydriven.
5ConditionsorWebQueries
TheconditionpartsofXChangerulesareexpressedinXcerpt[5,2,18],aWebandSemanticWebquerylanguage.Xcerpthasquerypatterns,calledqueryterms,forqueryingWebresources,andconstructionpatterns,calledconstructterms,montoquery,construct,anddataterms,isthattheyrepresentgraphs,i.e.ID/IDREFandotherXMLreferencesaredereferencedbyXcerpt.ThechildrenofthenodeofanXMLdocumentmightbeeitherorderedorunordered,i.e.duringqueryingwithXcerpt,theirordermightbemodi ed.InthetermsyntaxofXcerpt,anorderedtermspeci cationisdenotedbysquarebrackets[],anunorderedtermspeci cationbycurlybraces{}.
bib{massimo@person{first{"Massimo"},last{"Benedetti"}},
article{title{"QueryingXML"},authors{^massimo}},
article{title{"UpdatingXML"},authors{^massimo}}}
Fig.3.AXcerptDataTerm
DataTermsrepresentWebresources,i.e.XMLdocuments.InanXcerptpro-gram,theWebresourcestobequeriedarespeci edusingthekeywordresource,followedbytheURIsoftheresources.Figure3presentsanXcerptdatatermdescribingabibliography.Notethede ningoccurrencemassimo@...andthereferencingoccurrence^massimoofthereference,orpointer,massimo.
QueryTermsare(possiblyincomplete)patternsthatarematchedagainstWebresources.Bothpartial(i.e.incomplete)ortotal(plete)querypatternscanbespeci ed.Aquerytermtusingapartialspeci cation(denotedbydoublesquarebrackets[[]]orcurlybraces{{}})foritssubterms,matcheswithallsuchtermsthat(1)containmatchingsubtermsforallsubtermsoftandthat(2)mightcontainfurthersubtermswithoutcorrespondingsubtermsint.Incontrast,aquerytermusingatotalspeci cation(denotedbysinglesquarebrackets[]orcurlybraces{})doesnotmatchwithtermsthatcontainadditionalsubterms
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
7
withoutcorrespondingsubtermsint.Querytermscontainvariablesforselectingsubtermsofdatatermsthatareboundtothevariables.Variablerestrictionscanbeexpressedusingthe->construct(readas),whichrestrictthebindingsofthevariableattheleftof->tothosetermsmatchingwiththequerytermattherightof->.Figure4presentsaquerytermretrievingtheauthorsofarticleslistedinthedatatermofFigure3at.
in{resource{""}
bib{{article{{varWrote->authors}}}}}
Fig.4.AXcerptQueryTerm
Xcerptquerytermsmayuseadditionalconstructslikesubtermnegation(key-wordwithout),optionalsubterms(keywordoptional),anddescendant(key-worddesc)[18].Querytermsare“matched”againstdataorconstructtermsbyanon-standarduni cationmethodcalled“simulationuni cation”[6].
ConstructTermsservetoreassemblevariables(thebindingsofwhicharespec-i edinqueryterms)soastoconstructnewterms.Theyaresimilartodataterms,butareaugmentedbyvariables(actingasplaceholdersfordataselectedbyaquery)andthegroupingconstructsall(whichservetocollectallinstancesthatresultfromdi erentvariablebindings)andsomeorsomenwhichservetocollectoneorn(non-deterministicallychosen)instancesresultingfromdi erentvariablebindings.Occurrencesofall,some,orsomen,maybeaccompaniedbyanoptionalsortingspeci cation.
Construct-QueryRulesrelateaconstructterm(introducedbythekeywordCONSTRUCT)toaquery(introducedbythekeywordFROM)consistingof“and”and/or“or”connectedqueryterms.Queriesorpartsofaquerymaybefurtherrestrictedbyconstraints(e.g.arithmeticconstraints),inaso-calledconditionbox(introducedbythekeywordwhere).Agoalislikearule,exceptforthekeywordCONSTRUCTreplacedbyGOAL.Goalsspecifydatatobecomputedanddelivered,whilerulesspecifypossibleintermediatecomputations.A(query)pro-gramconsistsofoneormorerulesandofatleastonegoal.Xcerptrulesmaybechainedtoformcomplexqueryprograms,i.e.rulesmayquerytheresultsofotherrules.MoreonXcerptcanbefoundat[5,18].
6
6.1EventQueriesSyntaxofAtomicEventQueries
AtomicEventQueriesarepatternstobe“matched”againstincomingevents(attheWebnodewheretheatomiceventqueryisevaluated).TheyareinXChangeliketheyareinXcerpt,queryterms,theonlydi erencebeingthateventquerytermsneverrefertoaWebresource,unlikeXcerptqueryterms(recall:NoURIsforeventmessages!).Figure5presentsanatomiceventquery(watchingeventsannouncing ightcancellationsforMassimoBenedetti)withinanXChangerule(theactionandconditionofwhicharenotgiven).
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
8
RAISE
<action>
ON
xchange:event{{
flight-cancellation{{
flight-number{varNb},
passenger{{name{first{"Massimo"},last{"Benedetti"}}}}}}
}}
FROM
<condition>
END
Fig.5.AnAtomicEventQueryWithinanXChangeRule
6.2SyntaxofCompositeEventQueries
ACompositeEventQueryconsistsof(1)aconnectionof(atomicorcompos-ite)eventqueries(possiblywithwhereclauseslimitingvariablebindings)witheventcompositionoperatorssuchasand,andthen,or,andwithoutand(2)positeeventsareonlyde nedasanswersto,positeeventsdonothavetimestamps,incontrasttoeventmes-sages,i.e.atomicevents.Instead,acompositeeventinheritsfromitscomponentsabeginningtime(thereceptiontimeofthe rsteventmessagereceivedthatcon-tributestothecompositeevent)andanendingtime(thereceptiontimeofthelasteventmessagereceivedthatcontributestothecompositeevent).
Thefollowingnotations,possiblywithindices,areusedintherestofthesection:AtomicEventQuery,CompositeEventQuery,EventQuery(anatomicorcompositeeventquery),TimePoint,AbsTimeRange(anabsolutetimerange,i.e.ananchored nitetimeintervallikee.g.“fromJune3,2005toJuly4,2005”),RelTimeRange(arelativetimerange,i.e.anunanchored nitetimeintervallikee.g.“3days”),andTimeRange(anabsoluteorrelativetimerange).
6.2.1TemporalRanges
ATemporalRangeisatimeintervalduringwhichacompositeeventqueryistobeevaluated,i.e.onlyeventsreceivedduringthistimeintervalmightberelevanttotheeventquery.TemporalrangesarenecessaryforensuringthatnoeventsreceivedbythisnodemighthavetobekeptforeverforansweringsomecompositeeventqueriesposedatthisWebnode.Atemporaltimerangecanbeabsoluteorrelative.
aAnabsolutetemporalrangehaseithertheforminAbsTimeRange,ortheformbeforeTimePoint.Figure6presentstwocompositeeventqueriesthatdetectnewdiscountsfor ightsfromMunichtoParis.
ThecurrentprototypeimplementationofXChangeacceptstimepointsex-pressed,likeintheexamplesofFigure6,usingthe“restrictedpro le”ofISO8801[17],possiblyleavingoutthe“timezonedesignator”(thenconsideringim-
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
9
plicitlythetimezoneoftheWebnodeevaluatingtheeventquery).XChangehasadditionalconstructsbywhichonecande neabsolutetemporalrangesre-ferringtotheraisingorreceptiontimesofatomicevents,ortothebeginningorending(raisingorreception)timesofcompositeevents.Ifatemporalrangecanbederivedfromthetemporalrangesofthecomponentsofacompositeeventquery,thennoexplicittemporalrangeneedbespeci edforthisquery.xchange:event{{
flight{{
from{"Munich"},
to{"Paris"},
new-discount{varD}
}}
}}before"2005-08-10T14:00:00"xchange:event{{flight{{from{"Munich"},to{"Paris"},new-discount{varD}}}}}in["2005-08-10","2005-08-31"]
positeEventQuerieswithAbsoluteTemporalRanges
bArelativetemporalrangehastheformwithinDuration.Thecurrentim-plementationofXChangeacceptsdurationsexpressedasnumbersofyears,days,hours,minutesandseconds.Figure7presentsa(composite)eventquerywitharelativetemporalrange.
6.2.2EventCompositionOperators
aNon-TemporalEventCompositionOperators
a.1Conjunctionsofeventqueriesareusedfordetectinginstancesforeachspeci edeventqueryregardlessoftheirorder.Theyhavetheform:
and{EventQuery1,...,EventQueryn}
a.2InclusiveDisjunctionsofeventqueriesareusedfordetectinginstancesforoneofthespeci edeventqueries.Theyhavetheform:
or{EventQuery1,...,EventQueryn}
Ananswertothiseventqueryisthe rstanswerofoneoftheEventQueryitheevaluationofwhichcanbecompletedusingtheeventsreceivedsofar.bTemporalEventCompositionOperators
Thereceptiontimeofincomingatomiceventsdeterminesthetemporalorderofeventsthatthetemporaleventcompositionoperatorsreferto(theraisingtimeisanotheralternativecurrentlybeinginvestigated).ThetemporaleventcompositionoperatorsofXChangeinclude:orderings,eventexclusions,multipleselectionsandexclusions,branchings,andoccurrences.
b.1Orderings
b.1.1Temporallyorderedconjunctionsofeventqueriesdetectsuccessively,intermsoftheeventtemporalorder,instancesofevents.Theyhavetheforms:andthen[EventQuery1,...,EventQueryn]
andthen[[EventQuery1,...,EventQueryn]]
Atotalspeci cation(using[])expressesthatonlyinstancesoftheEventQueryi(i=1,...,n)areofinterestandareincludedintheanswer.Instancesofother
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
10
eventsthatpossiblyhaveoccurredbetweentheinstancesoftheEventQueryiarenotofinterestand,thus,arenotcontainedintheanswer.Incontrast,apartialspeci cation(using[[]])expressesinterestinallincomingeventsthathavebeenreceivedbetweentheinstancesoftheEventQueryi.Thus,alltheseinstancesarecontainedintheeventquery’sanswer.Figure7presentsaneventquerythatdetectsnoti cationsof ightcancellationsthatarefollowed,withintwohoursofreception,bynoti cationsthattheairlineisgrantingnoaccommodation.andthen[
xchange:event{{xchange:sender{""},
cancellation-notification{{flight{{number{varNb}}}}}}},xchange:event{{xchange:sender{""},
important{"Accommodationnotgranted!"}}}
]during2hours
Fig.7.ATemporallyOrderedConjunctionEventQuery
b.1.2Overlappingsofcompositeeventqueriesdetectinstancesofeventqueriesthatoverlaponthetimeaxisoftheincomingevents.
EventQuery1andEventQuery2overlapifthebeginningtimeofEventQuery1isbeforethebeginningtimeofEventQuery2andtheendingtimeofEventQuery1isafterthebeginningtimeofEventQuery2,orviceversa.
Orderedandunorderedspeci cationsarepossibleforoverlappingofcompos-iteeventqueries,i.eonehasthepossibilitytoexpressthatthetemporalorderisofimportanceornot.Thus,overlappingshavetheforms:
overlap[EventQuery1,EventQuery2]
overlap{EventQuery1,EventQuery2}
b.1.3Meetsforcompositeeventqueriesdetecteventqueryinstanceswhosecomponents“meet”onthetimeaxisoftheincomingevent.EventQuery1meetsEventQuery2iftheendingtimeofEventQuery1isthesameasthebeginningtimeofEventQuery2,orviceversa.Asforoverlappingsofcompositeeventqueries,orderedandunorderedspeci cationsarepossible.Thekeywordforthiseventcompositionoperatorismeet.
b.1.4Overlappingsormeetsforcompositeeventqueries,detecteventqueryinstanceswhosecomponentsoverlapormeetonthetimeaxisoftheincomingevents.overlap-or-meetisthekeywordforthiseventcompositionoperator.b.1.5Inclusionsforeventqueriesdetectinstancesofeventsthathaveoccurredduringthetimeintervaldeterminedbythebeginningtimeandendingtimeofaninstanceofacompositeeventquery.Thekeywordforthiseventcompositionoperatorisinclude.ThisoperatorisAllen’sduringrelation[1].
b.2EventExclusions
Theeventexclusionoperatorenablesthemonitoringofthenon-occurrenceof(atomicorcomposite)eventqueryinstances.i.e.toexpresseventqueriesexclud-ingsomeeventqueryinstances.Eventexclusionsquerieshaveoneoftheforms:CompositeEventQuerywithoutEventQuery
withoutEventQueryAbsTimeRange
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
11
Figure8presentsaneventexclusionquerydetectingifthenoti cationofanonlinereservationmadeon10thofAugust2005isnotreceivedwithintendays.withoutxchange:event{{
online-reservation-notification{{}}
}}in["2005-08-10","2005-08-20"]
Fig.8.AnEventExclusionQuery
b.3MultipleSelectionsAndExclusionsforeventquerieshavetheforms:mofEventQuery1,...,EventQuerynAbsTimeRange
atleastmofEventQuery1,...,EventQuerynAbsTimeRange
atmostmofEventQuery1,...,EventQuerynAbsTimeRange
The rstformrequires1≤m≤n.Itdetectsinstancesofmofthespeci edeventqueriesandthenon-occurrenceofinstancesofthen meventqueries,withinthegiventimeinterval.Theotherformsareself-explanatory.Multipleselectionandexclusionseventqueriesmustalwaysbeaccompaniedbythespeci cationofanabsolutetimerangeinwhichinstancesofthespeci edeventqueriesaretobemonitored.Notethatifm=1,the rstformisequivalenttoanexclusivedisjunction.Figure9presentsacompositeeventdetectingnoti cationsofeithercancellationorofanin-timedeparturefora ight.
1of{xchange:event{{xchange:sender{""},
cancellation-notification{{varFlight->
flight{{number{"AI2021"},date{"2005-08-10"}}}}}
}},
xchange:event{{xchange:sender{""},
in-time-departure-notification{{varFlight}}}}
}before"17:00"
Fig.9.AMultipleSelectionsAndExclusionsEventQuery
b.4Branchings
b.4.1Anif-then-elseeventcompositionoperatorgivesrisetoquerydi erenteventinstances,dependingwhetheraninstanceofaneventquery(speci edintheifpart)hasoccurredornot.
b.4.2Thecaseeventcompositionoperatorgeneralizestheif-then-elseoper-ator.Anoptionalelsepartcanbespeci edfordetectingeventqueryinstancesifnoneoftheeventqueriesofthecasepartcouldbeanswered.
b.5Occurrences
b.5.1Quanti cationsofeventqueriesservetodetecteventqueryinstancesoccurringatleast,atmost,orexactlyagivennumberoftimesinatimerange.Quanti cationshavetheforms:
ntimesEventQueryTimeRange
atmostntimesEventQueryTimeRange
atleastntimesEventQueryTimeRange
Figure10presentsacompositeeventquerymakingitpossibletoreactonlyafterthreeidenticalnoti cationsfromasecretariespoolwithin2hours.
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
12
atleast3timesxchange:event{{
xchange:sender{"/secretaries/"},
varNotification->important{{}}
}}within2hours
Fig.10.AnEventQuerySpecifying3OccurrencesofASameNoti cation
b.5.2Ranksservetodetectinstancesofeventquerieswithagivenposition,orrank,inthe positeeventquerieswithrankshavetheforms:EventQuerywithranknTimeRange
lastEventQueryTimeRange
Negativeranksdenoteeventqueryinstancescountedfromtheendoftheeventquerysequence,with 1denotingthelastoccurrence.Eventquerieswithlastornegativeranksmusthaveatimerangesoastodeterminethelastincomingevent.Figure11presentsaneventquerydetectingthelastnoti cationbefore10:00ofadelayedarrival.
lastxchange:event{{
xchange:sender{""},delay-notification{{varNotif}}}}before"10:00"
Fig.11.AnEventQueryWithRank
b.5.3Repetitionsareusedtodetecte.g.everysecond,third,etc.instancesofaspeci edeventqueryinagiventimerange.Theyhavetheform:
everynEventQueryTimeRange
Figure12presentsacompositeeventquerymakingitpossibletoreactonlytoeveryfourthmessagelabeledimportantfromthesecretariespoolwithinaworkday,atemporaltypede nedusingthecalendarsystemCaTTS[4],theintegrationofwhichwithXChangeiscurrentlyunderway.
every4xchange:event{{
xchange:sender{"/secretaries/"},important{{}}}}withinworkday
Fig.12.AnEventQuerySpecifyingaRepetition
6.3SemanticsofEventQueries
XChangeeventquerieshaveadeclarativesemantics[9]de nedintermsofaTarski-stylemodeltheory,i.e.thevaluationofacompositeeventquerywithre-specttoastreamofincomingeventsisde nedrecursivelyonaquery’sstructure.Ananswertoaneventquery,i.e.aneventqueryinstance,cantaketwoforms:aneventstreamformanda“resource”form.
Theeventstreamformofaneventqueryinstance,isthestreamofeventsselectedfromtheincomingstreambytheeventquery.Thisformensurestheanswer-closednessoftheeventquerylanguage,i.e.answersareofthesamekindasthedataqueried.Answer-closednessisanecessaryfeatureformodularprogramsspecifyingcomputationsinastepwisemanner.
The“resource”formofaneventqueryinstanceisanXMLdocument(storableasaWebresource,hencethename)structuredaftertheeventqueryandex-pressedeitherinthetermsyntaxorintheXMLsyntaxofXChangeeventqueries.
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
13
The“resource”formofaneventqueryinstanceisobtainedbybindingavariableusingtheXcerpt->(‘as’)constructtotheeventquery,thus“resource-ifying”eventqueryinstances.Thisvariableservesasa“handle”for“resource-ifying”eventinstancesandthusmakingthemusableinthe“condition”and/or“action”ofanXChangerule.“Resource-i cation”ofeventqueryinstancesisneededbe-causeofXChange’sposition:“NoURIsforeventmessages!”
XChangeeventquerieshaveaproceduralsemanticswhichisdatadriven,i.e.theevaluationofacompositeeventqueryisperformedincrementally,usingtheatomiceventsastheyarereceived.Theproceduralsemanticsissoundandcompletewithrespecttothedeclarativesemantics.
7Actions
TheactionofanXChangerulecanbe(1)thespeci cationof(oneormore)eventstoraise,i.e.thespeci cationofeventmessagestosendto(oneorsev-eral)Webnodes,(2)(oneormore)updaterequeststo(oneorseveral)Webnodes,or(3)(oneormore)transactions,i.e.groupsofeventstoraiseand/orupdaterequeststoperforminanall-or-nothingmanner:Thenoti cationbyaremoteWebnodeoftherejectionofapartofatransaction,isinterpretedbythe(XChange-aware)Webnodethathademittedthetransactionastherejectionofthewholetransaction.Speci ctransactionaleventmessagesareprovidedfornotifyingtherejectionofupdaterequestsortransactions.
XChangetransactionsobeytheACIDproperties[15]andTheycanbecalledweakbecause,incontrasttodatabasesystems,XChangedoesnotautomaticallyroll-backrejectedtransac-tions,butleavesthistasktotheWebnodethatemittedthetransaction,whereitcanbeimplementedwithspeci cXChangerules.ThisisconsistentwiththeXChangecommunicationmodeldiscussedinsection4,especiallywithXChange’snon-blocking‘sendoperation’,andwithXChange’slocalcontrolofeventsmen-tionedinsection4.ThedatabasesystemsstyleofautomaticrollbackwouldcontradictthesetwoparadigmsofXChangeandthede-centralisedmanagementoftheWeb.
XChangeupdaterequestsareexpressedbyupdatetermsbuiltupfromXcerpt’squeryandconstructterms:subtermdeletionsarespeci edsimilarlytoXcerptqueryterms,soastomakepossibleintensionalspeci cationsofdeletions,sub-terminsertionssimilarlytoXcerptconstructterms.Figure13presentsacom-positeaction(1)cancelingallappointmentsofBenedettionthe10thofAugust2005,(2)notifyingviaemailallthepersonsconcernedbythecancellations,and
(3)insertingannovelappointmentforBenedettionthatsameday.Notethein-tensionalspeci cationofthedeletionsusingthevariablesDelAppandEmailAdd,thegroupingall,andthetemporallyorderedconjunctionandthen[...]speci-fyinginwhichorderthethreeactioncomponentsshouldbeperformed.Enclosingancompositeactioninatermlabeledtransactionmakesitatransaction.
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
14
andthen[
in{resource{"organizer:///~benedetti/"},
organizer{{deletevarDelAppappointment{
receiving{last{"Benedetti"}},
visiting{{email{varEmailAdd}}},
when{{day{"2005-08-10"}}}
}}}
},
in{resource{"organizer:///benedetti/"},
organizer{{insertappointment{
receiving{first{"Massimo"},last{"Benedetti"}},
when{day{"2005-08-10"},from{"9:00"},to{"18:00"}}
}}}
},
allraise{
in{resource{"mailto:"varEmailAdd},
appointment-cancellation{varDelApp}
}
}
]
positeOrderedActionSpecifyingUpdatesandRaisingMessages8RelatedWorkAndConclusion
Allen’sTemporalRelations[1]havebeenanimportantinspirationinde ningthetemporaleventcompositionoperators.
ActiveDatabasesprototypesystemshavebeendevelopedthatprovidesophisti-catedeventalgebras,e.g.[8,7,11].Theircompositeeventshavebeenaninspi-rationforXChangeeventquerylanguage.
High-LevelReactiveLanguagesfortheWebformerlydeveloped,e.g.[13],supportsimpleupdateoperationsonXMLdocuments.Theyo ernomeanstospecifyseveralupdatestobeexecutedinagivenorderorinanall-or-nothingmanner.Otherrelatedworkcanbefoundin[12],whereXylemeisdescribed.XylemeisasystemformonitoringandsubscriptionontheWeb.AlertersmonitorsimpleupdatesofWebresources,amonitoringqueryprocessorperformsmorecomplexeventdetectionandsendnoti cationsofeventstoatriggerenginewhichper-formsactions.ThereactivefunctionalityofXylemeishighlytunedtoitsspeci capplication eld.
XChangesigni cantlydi ersfromand/orextendsovertheabove-mentionedapproacheswith(1)itsstructuredeventmessages,(2)itsdistinctionbetweenWebresourcesandeventmessages,(3)itslogicalvariablespossiblysharedbyitseventqueries,conditions,andactions,(4)itsweaktransactions,(5)itsdeclara-tivesemantics,and(6)itscommunicationanddistributedprocessingmodels.
ThisarticlehasintroducedXChange,stressingitsprinciplesandoutliningitssyntax,semantics,andprocessing.XChangeisanon-goingresearchprototype,whichwaspresentedinanearlierstatein[3].Thepresentpaperextendsthispreviouspublicationbyreportingonthenewlydevelopedtemporalcomposite
Abstract. This article introduces XChange, a rule-based reactive language for the Web. Stressing application scenarios, it first argues that high-level reactive languages are needed for both Web and Semantic Web applications. Then, it discusses technologie
15
eventoperator.On-goingworkonXChangeisdevotedtothetransactionspec-i cationlanguage,thetransactionalmessages,eventqueryoptimization,andonintegratingtheCaTTScalendrictypesystem[4].ApromisingperspectiveforfutureworkistoextendXChangewithsecurityfunctionalities,especiallyauthenticationandauthorization.TheprotocolsofaGridarchitecturesuchasGlobus[10],wouldprovidemeansforsuchanextension.Conversely,XChangecouldbeusedasthecoreofahigh-levelreactivelanguageforadvancedservicesontheGrid.
References
m.ACM,26:832–843,1983.
2.J.Bailey,F.Bry,T.Furche,andS.Scha ert.WebandSemanticWebQueryLanguages:ASurvey.InReasoningWeb,LNCS3564.Springer-Verlag,2005.
3.F.BryandP.-L.P atr anjan.ReactivityontheWeb:ParadigmsandApplicationsoftheLanguageXChange.InProc.20thAnnualACMSymp.AppliedComputing,2005.
4.F.Bry,F.-A.Rieß,andS.Spranger.CaTTS:CalendarTypesandConstraintsforWebApplications.InProc.14thIntl.WorldWideWebConference,2005.
5.F.BryandS.Scha ert.AGentleIntroductionintoXcerpt,aRule-basedQueryandTransformationLanguageforXML.InProc.Int.WorkshoponRuleMarkupLanguagesforBusinessRulesontheSemanticWeb,2002.
6.F.BryandS.Scha ert.TowardsaDeclarativeQueryandTransformationLan-guageforXMLandSemistructuredData:SimulationUni cation.InProc.Int.Conf.LogicProgramming,LNCS2401.Springer-Verlag,2002.
7.A.Buchmann,A.Deutsch,andJ.Zimmermann.TheREACHActiveOODBMS.InProc.ACMSIGNMODInt.Conf.ontheManagementofData,1995.
8.S.ChakravarthyandD.Mishra.SNOOP:AnExpressiveEventSpeci cationLan-guageforActiveDatabases.DataandKnowledgeEngineering,14(1),1994.
9.M.Eckert.ReactivityontheWeb:EventQueriesandCompositeEventDetectioninXChange.Master’sthesis,Inst.forInformatics,Univ.Munich,Germany,2005.
10.I.Foster,C.Kesselman,andS.Tuecke.TheAnatomyoftheGrid.Enabling
ScalableVirtualOrganizations.Int.Jour.ofSupercomputerApplications,2001.
11.R.Meo,G.Psaila,positeEventsinChimera.InProc.5thInt.
Conf.onExtendingDatabaseTechnology,1996.
12.B.Nguyen,S.Abiteboul,G.Cobena,andM.Preda.MonitoringXMLDataon
theWeb.InProc.ACMSIGMODConf.ontheManagementofData,2001.
13.G.Papamarkos,A.Poulovassilis,andP.Wood.Event-Condition-ActionRulesLan-
guagesfortheSemanticWeb.InProc.WorkshoponSemanticWebandDatabases,2003.
14.N.W.Paton.ActiveRulesinDatabaseSystems.Springer-Verlag,1999.
15.J.D.Ullman.PrinciplesodDatabaseandKnowledge-baseSystems,volume1.
ComputerSciencePress,1988.
16.J.WidomandS.Ceri.ActiveDatabaseSystems.MorganKaufmann,1996.
17.M.WolfandC.Wicksteed.DateandTimeformats.W3CNote,1997.
18.Xcerpt..
19.D.ZimmerandR.Unland.OntheSemanticsofComplexEventsinActive
DatabaseManagementSystems.InProc.15thInt.Conf.DataEngineering,1999.
- 1RULE规则
- 2Holomorphic L^{p}-functions on Coverings of Strongly Pseudoconvex Manifolds
- 3P&L(盈亏平衡表)
- 4P4C198L-25PMB中文资料
- 5Esterification of a Fatty Acid by Reactive Distillation
- 6L003003016-使用工具探测web服务器 - 图文
- 7Content and context aware networking using semantic tagging
- 8Semantic Role Labelling of Prepositional Phrases
- 9unit1 Language and Language Learning
- 106·L·199·P-2-茂名石化热处理工艺方案
- 教学能力大赛决赛获奖-教学实施报告-(完整图文版)
- 互联网+数据中心行业分析报告
- 2017上海杨浦区高三一模数学试题及答案
- 招商部差旅接待管理制度(4-25)
- 学生游玩安全注意事项
- 学生信息管理系统(文档模板供参考)
- 叉车门架有限元分析及系统设计
- 2014帮助残疾人志愿者服务情况记录
- 叶绿体中色素的提取和分离实验
- 中国食物成分表2020年最新权威完整改进版
- 推动国土资源领域生态文明建设
- 给水管道冲洗和消毒记录
- 计算机软件专业自我评价
- 高中数学必修1-5知识点归纳
- 2018-2022年中国第五代移动通信技术(5G)产业深度分析及发展前景研究报告发展趋势(目录)
- 生产车间巡查制度
- 2018版中国光热发电行业深度研究报告目录
- (通用)2019年中考数学总复习 第一章 第四节 数的开方与二次根式课件
- 2017_2018学年高中语文第二单元第4课说数课件粤教版
- 上市新药Lumateperone(卢美哌隆)合成检索总结报告
- P.L.
- Flavours
- reactive
- language
- Semantic
- XChange
- based
- rule
- Web
- 介绍 LAN transformer
- 冷凝集现象对血细胞分析仪检测结果的影响及处理_文宾
- 《数值分析》习题4(1)
- 小学奥数时钟问题
- 2010中考物理试题分类汇编(93套)专题二十九光声交叉
- 智障学生 生活适应《认识五官》 教案
- 第九章 非正式组织及其行为 管理心理学复习资料
- 新HSK1-4级词汇(6页打印版)
- 幂函数与指数函数的区别
- 工民建工程渗漏成因及防渗漏技术 3000
- 看红色书籍读后感(多篇)
- 2014_07_11_杭州云计算协会_讲座_Part_03_极致设计与创新力_ok
- 数据库系统概论(第四版)_王珊_萨师煊_chp7-2
- 伊宁长焰煤半焦催化气化的研究
- 五四主题团日活动策划
- 九年级物理生活中的透镜创新训练
- 2007年7月23日下午广东公务员面试真题试题及名师解析
- 2011年中考英语任务型阅读理解10篇
- 采购部绩效考核方案
- 轮回之章-羽翼六周年全攻略