[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Modern talking

  • From: Hans-Juergen Rennau <hrennau@yahoo.de>
  • To: XML Developers List <xml-dev@lists.xml.org>
  • Date: Sun, 27 Aug 2017 12:15:58 +0000 (UTC)

Modern talking
Recently, drowsing in a park, I became an involuntary witness of the following conversation.

Kolodopolus: Do you know what XQuery is?
Gaius: Sure, kind of SQL for XML, right?
K: I do not think that you understood well.
G: (raises eyebrows)
K: XQuery is a unified view of information.
G: Pardon?
K: A view answering two questions: What is information? What is an operation applied to information?
G: So, what is information?
K: A value.
G: What's a value?
K: A sequence of items.
G: What's an item?
K: Either a node, or an atom, or a map, or an array, or a function.
G: A function is ...
K: ... a mapping of values to a value.
G: And what is an "operation applied to information"?
K: It is an expression - a mapping of values (operands) to a value (the expession value).
G: Is XQuery mathematics, or philosophy?
K: Neither, or perhaps the translation of both into technological reality.
G: You don't expect me to understand what you mean?
K: It defines the syntax and semantics of a few dozens of expressions. At the heart of it all is the so-called path expression, which is about addressing tree-structured information. XQuery expressions are fully composable building blocks from which to construct processings of arbitrary complexity.
G: A mental world of expressions, with values flowing in and values flowing out!
K: Yes, sir.
G: I'm not blind to the intellectual beauty of such a closed system. But is it useful? Especially as the popularity of XML is declining?
K: XQuery has nothing to do with XML.
G: (laughts)
K: It's about information.
G: So in which context might XQuery be useful, and how?
K: A key field is DATA INTEGRATION.
G: Perhaps you give me an example?
K: Sure. Imagine you have a directory tree containing many .csv files. All of these should be constrained to contain in their third column only values found in a term list provided by yet another file, which is a JSON file. How would you check?
G: No problem, half a page of Python, I suppose ...
K: With XQuery it is a single expression, a single line spread over three for the sake of readibility.
G: Show me!
K: (picks up a stick and draws into the dust:)

let $dir := "/path/to/my/dir" return empty(
   file:list($dir, true(), "*.csv") ! concat($dir, '/', .) ! unparsed-text(.) ! csv:parse(.)/*/*/*[3]
      [not(. = unparsed-text($dir || '/foos.json') ! json:parse(.)//foo/_)])

G: Not bad. I notice you use extension functions defined by BaseX, not part of the official standard.
K: That's right.
G: So when will the next version of the standard be out, to make such things possible in a purely standards-based way?
K: There won't be a next version of the standard.
G: Wait a minute - if XQuery gives us a radically new way of thinking information in a unified way - is this not like a road on which we have hardly begun to walk?
K: (Gets up.) This you should ask the W3C.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.