XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS