xquery just a query language for xml right no no no
play

XQUERY? Just a query Language for XML? Right? NO NO - PowerPoint PPT Presentation

XQuery vs . The World Nuno Job nunojob.com nunojob.com and @dscape dscape (twitter, github) Dynamic Languages Conference 2011 portugal, new york, toronto, san francisco, london 11


  1. XQuery ¡ vs . ¡ The ¡ World ¡ Nuno Job � ¡ nunojob.com nunojob.com and @dscape dscape (twitter, github) � ¡ ¡ Dynamic ¡Languages ¡Conference ¡2011 ¡

  2. portugal, new york, toronto, san francisco, london � 11 � 83 � 08 � 10 � 09 � H ¡E ¡L ¡L ¡O ¡ past. � ¡ s i ¡ e m a n ¡ Nuno � y m present. � stuff I like � @dscape �

  3. also stores: � unstructured � text and binaries � c++ core � schema-less* � ~ pb scale � easy evolution. � xml or json. � features � acid, backups � replication, query � native search � language (XQuery). � a database built � on a search engine? � !! � stop shredding your data � no tables, rows, columns � start storing data as is � thinkin’ documents � uris? looks like a filesystem � * they have this universal index thing. � an inverted index that is structure aware �

  4. XQUERY? ¡

  5. Just ¡a ¡query ¡Language ¡for ¡XML? ¡ ¡ Right? ¡

  6. NO ¡NO ¡NO ¡ NO ¡NO ¡NO ¡ NO ¡NO ¡NO ¡

  7. Ok, ¡ok… ¡ YES , ¡but… ¡

  8. SQL ¡Like? � for $name in //json:name let $first := fn:tokenize($name, " ")[1] where $first != 'chad' return $name

  9. ¡ but… ¡

  10. Literals ¡ <names> { for $name in //name return <name>{$name}</name> } </names>

  11. FuncGons ¡ ¡ declare ¡funcGon ¡local:hello($name) ¡{ ¡ ¡ ¡concat("Hello ¡", ¡$name) ¡ }; ¡ function � ¡ local:hello("Edinburgh!") ¡ main �

  12. High ¡Order ¡FuncGons ¡ declare function fold($f, $z, $l) { if(empty($l)) then $z else fold( $f, xdmp:apply($f, $z, head($l)), tail($l)) } ; https://github.com/dscape/dxc �

  13. Meta ¡Programming ¡ mustache:render( ‘ Hello {{name}}! 
 You have just won {{value}} usd! {{#in_ca}} Well, {{taxed_value}} usd, 
 after taxes. {{/in_ca}} ’, ‘ { "name": "Chris", "value": 10000, "taxed_value": 
 10000 - (10000 * 0.4), "in_ca": true } ’) https://github.com/dscape/mustache.xq �

  14. Data ¡Model ¡ xdm � xdm � xquery � zero or more items � item is � either an atomic type (like string or integer) � or a tree �

  15. Element node Attribute Node Text Node

  16. NavigaGon ¡language ¡(XPath) ¡ child axis � /user ¡ predicate � ¡ ¡[sex="male"] ¡ ¡ ¡ ¡ ¡//name ¡ descendants � ¡ ¡ ¡ ¡ ¡ ¡/text() ¡ node test � similar to file paths but you can have � repeated element in xml, unlike filesystems � where folders are unique �

  17. Side ¡Effect ¡Free ¡ if($user) then ($user) else () * actually this is the same as just $user �

  18. Great ¡for ¡querying ¡documents ¡ ( for $song in /top-song let $artist := $song/artist let $recorded := $song/recorded let $london := geo:latLong ("London") where $artist = "Queen" and not($recorded=$london) order by $song/weeks/@last descending return song:render($song) ) [1 to 10]

  19. JavaScript ¡is ¡to ¡JSON ¡ ¡ like ¡XQuery ¡is ¡to ¡XML ¡ and there are plenty of problems for which and there are plenty of problems for which xml is a better fit xml is a better fit �

  20. Q U E R I E S ¡ P A R S E R S ¡ TEMPLATING ¡ ENGINES ¡ WEB ¡ APPS ¡ APIS ¡ URL ¡ REWRITERS ¡ ¡ SCRIPTS ¡ FRAMEWORKS ¡ MOBILE ¡ ¡ E N T E R P R I S E ¡ A P P S ¡ BROWSER ¡ LANGUAGES ¡

  21. XQuery ¡ ¡ ¡ A ¡fully ¡fledged ¡ dynamic ¡ funcEonal ¡ programming ¡language ¡ also a query language for xml… also a query language for xml… �

  22. disagree? � hfp://bit.ly/sqlfordocs ¡ STILL ¡WANT ¡YOUR ¡DOCUMENT ¡ DATABASE ¡TO ¡SUPPORT ¡SQL ¡ AND ¡ONLY ¡SQL? ¡ ¡ ¡ WHY ¡OH ¡WHY? ¡

  23. Lifle ¡know ¡facts ¡ WHY ¡CARE? ¡

  24. in average (in the uk) there is one job posting in indeed for each two people that state they know xquery � in linkedin � WELL ¡PAID ¡ HIGH ¡DEMAND, ¡LOW ¡SUPPLY ¡

  25. http://writings.nunojob.com/slides/2011-bbuzz.pdf � http://vimeo.com/26777627 � that looks fun � WORKING ¡ON ¡PB ¡SCALE ¡DEPLOYMENTS ¡ WITH ¡ACID ¡TRANSACTIONS? ¡

  26. ANYONE ¡USING ¡IT? ¡

  27. go check our customer list. it’s likely you’ll be go check our customer list. it’s likely you’ll be surprised to find out you use surprised to find out you use marklogic marklogic after all after all � Yup! ¡

  28. free download & fair use � hfp://developer.marklogic.com ¡ DID ¡I ¡FORGOT ¡TO ¡MENTION ¡THE ¡COOL ¡ STUFF ¡WE ¡DO ¡AT ¡ MARKLOGIC ? ¡

  29. � XQuery ¡in ¡one ¡slide ¡ W3C Open Standard � update ¡ Standalone programming language � XQuery ¡ Data Focused � Single Tier Development � Rich API � ¡ ¡ insert ¡ Regular expressions, XML AnyDB strings, sequences, etc… � serialize ¡ Extensible with your own update ¡ libraries � serialize ¡ Side-effect free � deserialize ¡ Great for concurrency � XML XML transmit ¡ XDM � SQL ¡ Java ¡ JDBC ¡

  30. learn ¡something ¡ new ¡ every ¡day ¡

  31. Thank ¡you! ¡QuesGons? ¡ @DSCAPE ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend