SlideShare a Scribd company logo
1 of 38
Download to read offline
28   msec
            XQuery 3 Rocks
            http://www.zorba-xquery.com
            William Candillon - FOSDEM 2012
Harnessing Flexible Data
{
    "photos": {
      "page": 1,
      "pages": 94276,
      "total": "1414129",
      "photo": [{
        "id": "3891667770",
        "owner": "354683133120"

<kml>
  <Placemark>
    <name>Simple placemark</name>
    <Point>
<coordinates>-122.0822035425683,37.422289901
40251,0</coordinates>
{
        "photos": {
          "page": 1,
          "pages": 94276,
          "total": "1414129",
          "photo": [{
            "id": "3891667770",
            "owner": "354683133120"

    <kml>




✔
      <Placemark>
        <name>Simple placemark</name>
        <Point>
    <coordinates>-122.0822035425683,37.422289901
    40251,0</coordinates>
{
        "photos": {
          "page": 1,
          "pages": 94276,
          "total": "1414129",
          "photo": [{
            "id": "3891667770",
            "owner": "354683133120"




                                           ?
    <kml>




✔
      <Placemark>
        <name>Simple placemark</name>
        <Point>
    <coordinates>-122.0822035425683,37.422289901
    40251,0</coordinates>




?                                          ?
Meet XQuery
XQuery



   •   Family of Specification from w3c

   •   Most Complex Complete Data Model

   •   Talks Natively to Web

   •   Query, Store, Index, Update, Full-Text

   •   Unified Framework

   •   Optimization & Parallelization
Meet Zorba

         Open Source XQuery Processor
         Contributors: Oracle, 28msec, FLWOR


   All Flavors Available      Runs Everywhere


   Rich Module Libraries      Developer Tools


   Pluggable Store            Fun & Productive
Zorba
<div id=”entries”>{
  for $entry in $entries
  let $title := string($entry/@title)
  where $entry/@author = “anonymous”
  order by $entry/@datetime
  return <h1>{$title}</h1>
}</div>
insert node <entry>Hello World</entry>
       into $entries
let $x := <m>breakfast of champions</m>
return $x contains text "meal"
  using thesaurus at
    "http://wordnet.princeton.edu"
  relationship "narrower term"
let $handler :=
  function($request){
    let $world := $request/text()
    return
      <h1>Hello {$world}!</h1>
  }
return mongoose:start($handler, 80);

mongoose:cin();
declare
%http:get(“/hello/{$world}”)
function html:hello($world)
{
   <h1>Hello {$world}!</h1>
};
Client                                         Server

<script type="application/xquery">
declare sequential function local:submit($loc,     declare sequential function guestbook:add(
$evtObj)                                              $author as xs:string, $entry as xs:string
{                                                  ){
                                                      let $date   := fn:current-dateTime()
     let $name    := s:id("author")/data(@value)      let $entry := <entry author="{$author}"
     let $text    := s:id("text")/text()                        datetime="{$date}">{$text}</entry>
     return                                           return
       guestbook:add($name, $text);                      xqddf:insert-nodes-last($entries, $entry);
};                                                 };

b:addEventListener(s:id("submit"),                 declare sequential function guestbook:list() {
                  "onclick",                          <entries>{
                   local:submit#2);                     xqddf:collection($entries)
                                                      }</entries>;
guestbook:list();                                  };
</script>
Client                                         Server

<script type="application/xquery">
declare sequential function local:submit($loc,     declare sequential function guestbook:add(
$evtObj)                                              $author as xs:string, $entry as xs:string
{                                                  ){
                                                      let $date   := fn:current-dateTime()
     let $name    := s:id("author")/data(@value)      let $entry := <entry author="{$author}"
     let $text    := s:id("text")/text()                        datetime="{$date}">{$text}</entry>
     return                                           return
       guestbook:add($name, $text);                      xqddf:insert-nodes-last($entries, $entry);
};                                                 };

b:addEventListener(s:id("submit"),                 declare sequential function guestbook:list(){
                  "onclick",                          <entries>{
                   local:submit#2);                     xqddf:collection($entries)
                                                      }</entries>;
guestbook:list();                                  };
</script>




         Seamless Invocations
AWS Libraries (2011)

                                       Java               XQuery

                    8589
    Lines of code




                                          2905
                                                              2309
                                1469

                                                    572                    455


                           S3                 SimpleDB               SNS
AWS Libraries (2011)

                Java            XQuery

                 13803




                                         Lines of Codes
Lines of code




                                             - 80%
                               2496




                         AWS
AWS Libraries (2011)

                PHP             XQuery

                 6531




                                         Lines of Codes
Lines of code




                              2496
                                             - 62%

                        AWS
<html>
  <head>
    <script type='text/javascript'>
    function buy(e) {
       newElement = document.createElement("p");
       elementText = document.createTextNode
                  (e.target.getAttribute(id));
       newElement.appendChild(elementText);
       var res = document.evaluate(
         "//div[@id='shoppingcart']",
         document, null,
         XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
                                                              HTML
         null);
       res.snapshotItem(0).appendChild("newElement");}
    </script>                                               JavaScript
  </head>
  <body>
    <div>Shopping cart</div>
    <div id="shoppingcart"></div>
    <%
                                                             XPath
       // Code establishing connection
       ResultSet results =
       statement.executeQuery ("SELECT * FROM PRODUCTS");
       while (results.next()) {
         out.println("<div>");
                                                               Java
         String prodName = results.getString(1);
         out.println(prodName);

                                                              SQL
         out.println("<input type='button' value='Buy'");
         out.println("id='"+prodName+"'");
         out.println("onclick='buy(event)'/>").
         out.println("</div>");
       }
       results.close();
       // Code closing connection
    %>
  </body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
    <script type='application/xquery'>
declare updating function local:buy($evt, $obj) {
   insert node <p>{$obj/@id}</p> as first
     into //div[@id="shoppingcart"]
};
b:addEventListener(b:dom()//input,
                     "onclick",
                     xs:Qname("local:buy"));
</script>
   </head>
   <body>
     <div>Shopping cart</div>
     <div id="shoppingcart">{
                                                    XQuery Everywhere
       for $p in doc("products.xml")//*:product
       return
          <div>
            {$p/*:name}
            <input type='button'
                   value='Buy'
                   id='{$p/*:name}'/>
          </div>
     }</div>
   </body>
</html>
let $stats := [ { "response_time":
0.05 ... } ...]
for $stat in j:values($stats)
let $url := $stat("http_action")
order by $url
return
{
  "url": $url,
  "avg": avg($stat("response_time"))
}
$zorba -q jsoniq.xq -f
{ "url" : "GET /docs/spec/en-US/html-
single/index.html", "avg" : 0.05 }
Take away


   • Powerful Data Model
   • Flexible Programming Model
   • Productivity
   • Performance
28   msec
            Thank you!

More Related Content

What's hot

Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using RoomNelson Glauber Leal
 
Hd insight programming
Hd insight programmingHd insight programming
Hd insight programmingCasear Chu
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuerydeimos
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutesSimon Willison
 
History of jQuery
History of jQueryHistory of jQuery
History of jQueryjeresig
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Ben Lesh
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkShahar Evron
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for CassandraEdward Capriolo
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015StampedeCon
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuerySudar Muthu
 
Cassandra and materialized views
Cassandra and materialized viewsCassandra and materialized views
Cassandra and materialized viewsGrzegorz Duda
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceAmazon Web Services
 
Aplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackAplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackNelson Glauber Leal
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery FundamentalsGil Fink
 

What's hot (19)

Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
Hd insight programming
Hd insight programmingHd insight programming
Hd insight programming
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuery
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
History of jQuery
History of jQueryHistory of jQuery
History of jQuery
 
jQuery
jQueryjQuery
jQuery
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015
 
Drupal 8: Fields reborn
Drupal 8: Fields rebornDrupal 8: Fields reborn
Drupal 8: Fields reborn
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
 
Cassandra and materialized views
Cassandra and materialized viewsCassandra and materialized views
Cassandra and materialized views
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
Fatc
FatcFatc
Fatc
 
Aplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackAplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e Jetpack
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 

Viewers also liked

The Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student LifeThe Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student LifePhillip Jeffrey
 
Performance and Creativity
Performance and CreativityPerformance and Creativity
Performance and CreativityPhillip Jeffrey
 
The Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, PhotographyThe Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, PhotographyPhillip Jeffrey
 
Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?lisbk
 
Thinking The Unthinkable: Introduction
Thinking The Unthinkable: IntroductionThinking The Unthinkable: Introduction
Thinking The Unthinkable: Introductionlisbk
 
7 pragmatic initiatives to improve your CX in 2017
7 pragmatic initiatives to improve your CX in  20177 pragmatic initiatives to improve your CX in  2017
7 pragmatic initiatives to improve your CX in 2017Stefan Kolle
 
Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBWilliam Candillon
 
10 things to make you think
10 things to make you think10 things to make you think
10 things to make you thinkStefan Kolle
 

Viewers also liked (11)

The Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student LifeThe Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student Life
 
Performance and Creativity
Performance and CreativityPerformance and Creativity
Performance and Creativity
 
My Summer of Code
My Summer of CodeMy Summer of Code
My Summer of Code
 
The Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, PhotographyThe Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, Photography
 
Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?
 
Thinking The Unthinkable: Introduction
Thinking The Unthinkable: IntroductionThinking The Unthinkable: Introduction
Thinking The Unthinkable: Introduction
 
Facebook
FacebookFacebook
Facebook
 
Extending and scripting PDT
Extending and scripting PDTExtending and scripting PDT
Extending and scripting PDT
 
7 pragmatic initiatives to improve your CX in 2017
7 pragmatic initiatives to improve your CX in  20177 pragmatic initiatives to improve your CX in  2017
7 pragmatic initiatives to improve your CX in 2017
 
Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDB
 
10 things to make you think
10 things to make you think10 things to make you think
10 things to make you think
 

Similar to XQuery Rocks

Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejsNick Lee
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platformsAyush Sharma
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012ghnash
 
Spring data iii
Spring data iiiSpring data iii
Spring data iii명철 강
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation FrameworkCaserta
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourPeter Friese
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門Tsuyoshi Yamamoto
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologyDaniel Knell
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETJames Johnson
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkIndicThreads
 

Similar to XQuery Rocks (20)

Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Jquery
JqueryJquery
Jquery
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platforms
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Spring data iii
Spring data iiiSpring data iii
Spring data iii
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
jQuery
jQueryjQuery
jQuery
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 

XQuery Rocks

  • 1. 28 msec XQuery 3 Rocks http://www.zorba-xquery.com William Candillon - FOSDEM 2012
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 11. { "photos": { "page": 1, "pages": 94276, "total": "1414129", "photo": [{ "id": "3891667770", "owner": "354683133120" <kml> <Placemark> <name>Simple placemark</name> <Point> <coordinates>-122.0822035425683,37.422289901 40251,0</coordinates>
  • 12. { "photos": { "page": 1, "pages": 94276, "total": "1414129", "photo": [{ "id": "3891667770", "owner": "354683133120" <kml> ✔ <Placemark> <name>Simple placemark</name> <Point> <coordinates>-122.0822035425683,37.422289901 40251,0</coordinates>
  • 13. { "photos": { "page": 1, "pages": 94276, "total": "1414129", "photo": [{ "id": "3891667770", "owner": "354683133120" ? <kml> ✔ <Placemark> <name>Simple placemark</name> <Point> <coordinates>-122.0822035425683,37.422289901 40251,0</coordinates> ? ?
  • 15. XQuery • Family of Specification from w3c • Most Complex Complete Data Model • Talks Natively to Web • Query, Store, Index, Update, Full-Text • Unified Framework • Optimization & Parallelization
  • 16. Meet Zorba Open Source XQuery Processor Contributors: Oracle, 28msec, FLWOR All Flavors Available Runs Everywhere Rich Module Libraries Developer Tools Pluggable Store Fun & Productive
  • 17. Zorba
  • 18. <div id=”entries”>{ for $entry in $entries let $title := string($entry/@title) where $entry/@author = “anonymous” order by $entry/@datetime return <h1>{$title}</h1> }</div>
  • 19. insert node <entry>Hello World</entry> into $entries
  • 20. let $x := <m>breakfast of champions</m> return $x contains text "meal" using thesaurus at "http://wordnet.princeton.edu" relationship "narrower term"
  • 21. let $handler := function($request){ let $world := $request/text() return <h1>Hello {$world}!</h1> } return mongoose:start($handler, 80); mongoose:cin();
  • 23.
  • 24. Client Server <script type="application/xquery"> declare sequential function local:submit($loc, declare sequential function guestbook:add( $evtObj) $author as xs:string, $entry as xs:string { ){ let $date := fn:current-dateTime() let $name := s:id("author")/data(@value) let $entry := <entry author="{$author}" let $text := s:id("text")/text() datetime="{$date}">{$text}</entry> return return guestbook:add($name, $text); xqddf:insert-nodes-last($entries, $entry); }; }; b:addEventListener(s:id("submit"), declare sequential function guestbook:list() { "onclick", <entries>{ local:submit#2); xqddf:collection($entries) }</entries>; guestbook:list(); }; </script>
  • 25. Client Server <script type="application/xquery"> declare sequential function local:submit($loc, declare sequential function guestbook:add( $evtObj) $author as xs:string, $entry as xs:string { ){ let $date := fn:current-dateTime() let $name := s:id("author")/data(@value) let $entry := <entry author="{$author}" let $text := s:id("text")/text() datetime="{$date}">{$text}</entry> return return guestbook:add($name, $text); xqddf:insert-nodes-last($entries, $entry); }; }; b:addEventListener(s:id("submit"), declare sequential function guestbook:list(){ "onclick", <entries>{ local:submit#2); xqddf:collection($entries) }</entries>; guestbook:list(); }; </script> Seamless Invocations
  • 26.
  • 27.
  • 28.
  • 29. AWS Libraries (2011) Java XQuery 8589 Lines of code 2905 2309 1469 572 455 S3 SimpleDB SNS
  • 30. AWS Libraries (2011) Java XQuery 13803 Lines of Codes Lines of code - 80% 2496 AWS
  • 31. AWS Libraries (2011) PHP XQuery 6531 Lines of Codes Lines of code 2496 - 62% AWS
  • 32. <html> <head> <script type='text/javascript'> function buy(e) { newElement = document.createElement("p"); elementText = document.createTextNode (e.target.getAttribute(id)); newElement.appendChild(elementText); var res = document.evaluate( "//div[@id='shoppingcart']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, HTML null); res.snapshotItem(0).appendChild("newElement");} </script> JavaScript </head> <body> <div>Shopping cart</div> <div id="shoppingcart"></div> <% XPath // Code establishing connection ResultSet results = statement.executeQuery ("SELECT * FROM PRODUCTS"); while (results.next()) { out.println("<div>"); Java String prodName = results.getString(1); out.println(prodName); SQL out.println("<input type='button' value='Buy'"); out.println("id='"+prodName+"'"); out.println("onclick='buy(event)'/>"). out.println("</div>"); } results.close(); // Code closing connection %> </body> </html>
  • 33. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type='application/xquery'> declare updating function local:buy($evt, $obj) { insert node <p>{$obj/@id}</p> as first into //div[@id="shoppingcart"] }; b:addEventListener(b:dom()//input, "onclick", xs:Qname("local:buy")); </script> </head> <body> <div>Shopping cart</div> <div id="shoppingcart">{ XQuery Everywhere for $p in doc("products.xml")//*:product return <div> {$p/*:name} <input type='button' value='Buy' id='{$p/*:name}'/> </div> }</div> </body> </html>
  • 34. let $stats := [ { "response_time": 0.05 ... } ...] for $stat in j:values($stats) let $url := $stat("http_action") order by $url return { "url": $url, "avg": avg($stat("response_time")) }
  • 35. $zorba -q jsoniq.xq -f { "url" : "GET /docs/spec/en-US/html- single/index.html", "avg" : 0.05 }
  • 36. Take away • Powerful Data Model • Flexible Programming Model • Productivity • Performance
  • 37.
  • 38. 28 msec Thank you!