Upload
william-candillon
View
14.888
Download
1
Embed Size (px)
DESCRIPTION
Not Your Grandmarsquos XQueryKey Features amp Perspectives
William Candillon candillon28mseccomXML Amsterdam 2011
28 msec
ldquoWhat I saw in your five-minutes talk hardly looks at all like the XQuery I saw back thenrdquo
- Daniel Weinred Google
Not Your Grandmarsquos XQuery
Download the CoreSDK
Deploy in one-click
Automatic Scaling
bull
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
ldquoWhat I saw in your five-minutes talk hardly looks at all like the XQuery I saw back thenrdquo
- Daniel Weinred Google
Not Your Grandmarsquos XQuery
Download the CoreSDK
Deploy in one-click
Automatic Scaling
bull
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Not Your Grandmarsquos XQuery
Download the CoreSDK
Deploy in one-click
Automatic Scaling
bull
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Download the CoreSDK
Deploy in one-click
Automatic Scaling
bull
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Deploy in one-click
Automatic Scaling
bull
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Automatic Scaling
bull
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
bull
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Client JavaScript
Middleware Java
Content Management
Lucene
Database MySQL
Application Stack
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Client JavaScript
XQueryMiddleware Java
XQueryContent
ManagementLucene
XQuery
Database MySQL
XQuery
Application Stack
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Application Stack
Client
XQuery
in the Browser
Middleware
XQueryScripting
Content Management
XQueryFull-Text
Database
XQuery
Data Definition Facility
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
XQuery Data Definition Facility
bull Open Specification (httpgooglXzK8p)
bull Implemented by Zorba (httpgoogl4huso)
bull Extending XQuery with
- Collections
- Indexes
- Integrity Contraints
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare collection fforecasts as element(forecast)
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Properties
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Name
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Domain Expression
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring
Index Key
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare automatic value-equality non-unique index fforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by site-id as xsstring city as xsstring
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare automatic value-range indexfforecasts-index on nodes cdmlcollection(xsQName(fforecasts)) by temperature as xsdecimal
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
$ sausalito backup dataBackup data for project at UserstestforecastProject URI httpwwwexamplecom
Starting backup for collection data OKBackup successful
$ sausalito restore data -f forecasttargzRestored data
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Full-Text
bull XQuery and XPath Full Text 10
bull Thesaurus
bull Stemming
bull Complete access to the full text internalsfttokenize($node $lang)fttokenizer-properties()
ftthesaurus-lookup($uri $phrase)
ftstem($work)
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
$dataelement()[ contains text $search-term]
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
let $x = ltmsggtbreakfast of championsltmsggtreturn $x contains text meal using thesaurus at httpwordnetprincetonedu relationship narrower term
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
ftstem( flavoring xslanguage(en) )
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
let $doc = doc(ldquodocxmlrdquo)for $token in fttokenize($doc)return concat($tokenvalue ldquo at rdquo $tokenparagraph $tokensentence )
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Scripting
bull Open Specification
bull Implemented by Zorba
bull Friendly syntax for imperative programming
bull Semantic for side-effects
bull Specification at httpgooglkTYuf
bull Tutorial at httpgooglF23je
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
let $handler = function($request) let $world = $requesthttpbodytext() return lth1gtHello $worldlth1gt return mongoosestart($handler 8080)mongoosecin()
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
while(true()) variable $request = serverlisten(localhost 8080) variable $response = apiprocess($request) apiserialize($response)
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
if(count($result) lt count($collection)) then httpset-header(x-truncated true) httpset-header(x-next apistart=7b5c28c0) else httpset-header(x-truncated false)$result
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
in the Browser
bull Open Source Project from ETH
bull httpxqiborg
bull XQuery in the browser without a plug-in
bull Processor compiled to JavaScript
bull DOM as the processor store
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
ltscript type=rdquoapplicationxqueryrdquogtbaddEventListener(bdom()button onclick function($ev $obj) balert(ldquoClickedrdquo) )ltscriptgt
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
ltscript type=textjavascriptgtfoo = function (arg) return the text was + argltscriptgt
ltscript type=applicationxquerygt let $x = bjs-call(windowfoo ldquoFoordquo) return balert($x)ltscriptgt
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
ltscript type=applicationxquerygtbjs-eval(windowalert(eval))ltscriptgt
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
declare variable $uieasing = (0 002 008 019 033 05 067 081 092 098 1)
declare sequential function uifade() declare $con = bdom()[id = entries] declare $opacity = bgetStyle($con opacity) if($opacity lt 1) then ( bsetStyle($con opacity $uieasing[ gt $opacity][1]) btimer(100 uifade0) ) else bsetStyle($con opacity 1)
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
ltscript type=applicationxquerygtdeclare sequential function localsubmit($loc $evtObj)
let $name = sid(author)data(value) let $text = sid(text)text() return guestbookadd($name $text) baddEventListener(sid(submit) onclick localsubmit2)
guestbooklist()ltscriptgt
declare sequential function guestbookadd( $author as xsstring $entry as xsstring) let $date = fncurrent-dateTime() let $entry = ltentry author=$author datetime=$dategt$textltentrygt return xqddfinsert-nodes-last($entries $entry)
declare sequential function guestbooklist() ltentriesgt xqddfcollection($entries) ltentriesgt
Client Server
Seamless Invocations
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Pubzone (2009)
Java XQuery
1210900
1830
4100
450
3100
Line
s of
cod
eModel ViewControler
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
AWS Libraries
S3 SimpleDB SNS
455572
1469
23092905
8589
Line
s of
cod
eJava XQuery
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
AWS Libraries
AWS
2496
13803
Line
s of
cod
eJava XQuery
Lines of Codes- 80
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
AWS Libraries
AWS
2496
6531
Line
s of
cod
ePHP XQuery
Lines of Codes- 62
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
lthtmlgt ltheadgt ltscript type=textjavascriptgt function buy(e) newElement = documentcreateElement(p) elementText = documentcreateTextNode (etargetgetAttribute(id)) newElementappendChild(elementText) var res = documentevaluate( div[id=shoppingcart] document null XPathResultUNORDERED_NODE_SNAPSHOT_TYPE null) ressnapshotItem(0)appendChild(newElement) ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgtltdivgt lt Code establishing connection ResultSet results = statementexecuteQuery (SELECT FROM PRODUCTS) while (resultsnext()) outprintln(ltdivgt) String prodName = resultsgetString(1) outprintln(prodName) outprintln(ltinput type=button value=Buy) outprintln(id=+prodName+) outprintln(onclick=buy(event)gt) outprintln(ltdivgt) resultsclose() Code closing connection gt ltbodygtlthtmlgt
HTMLJavaScript
XPath
Java
SQL
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
lthtml xmlns=httpwwww3org1999xhtmlgt ltheadgt ltscript type=applicationxquerygtdeclare updating function localbuy($evt $obj) insert node ltpgt$objidltpgt as first into div[id=shoppingcart]baddEventListener(bdom()input onclick xsQname(localbuy))ltscriptgt ltheadgt ltbodygt ltdivgtShopping cartltdivgt ltdiv id=shoppingcartgt for $p in doc(productsxml)product return ltdivgt $pname ltinput type=button value=Buy id=$pnamegt ltdivgt ltdivgt ltbodygtlthtmlgt
XQuery Everywhere
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Wadlers theorem of language adoption
ldquoA programming language will be adopted if and only if it permits its users to do something that cannot be done in any other wayrdquo
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
SQLJavaJavaScript
GO
Mapping
Glue
Mapping
Glue
XQuery
SeamlessInvocations
XQuery
GO
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
SQLJavaJavaScript
GO
Mapping
Glue
LocalStore
Sync Sync
XQuery
GO
LocalStore
XQuery
Seamless Synchronisation
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Demo Offline XQuery App
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
XQuery in Mobile Apps
bull 2 XQuery Stores- DOM- HTML5 Local Storage
bullWhen Offline - Each update is applied to local store - Pending Update Lists are stored in the local store
bullWhen Online - PULs are aggregated and sent to the Cloud - PULs are applied to the Cloud
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs ltinsert src=rdquordquo target=rdquordquo gt
1 Apply PUL Store PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOs lttodo done=rdquotruerdquogt
PULs
2 Send PUL
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
insert node attribute done ldquotruerdquo into xqddfcollection($todos)[id = $id]
Local Store
TODOS lttodo done=rdquotruerdquogt
PULs
3 Apply PUL
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Operators on Updates
bull Aggregationbull Integration (+ detecting conflicts)bull Reconciliation of conflictsbull Reductionbull Inversion
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Spacial Axis
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Time Axis
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
$tempB$tempA
avg( $tempAfuture-or-current intersect $tempBpast-or-current)
68deg 70deg 65deg 69deg 72deg
Text
Time
Thank you28 msec
Thank you28 msec