I keep a couple of google alerts for all things XQuery and I was very pleased to see this headline pop up a couple of days ago:
XQuery: The Search Language For A Multi-Platform Future
The advent of wireless internet access has made web design a very complicated matter. Previously, all web browsers were created equal. HTML was the only language used to create web sites, and it was only possible to go online with a ...
Wow! Along with the XML.com article XQuery, the Server Language here is someone who really gets the power of XQuery as an application . . . and for search too!
And it's true, XQuery really is the search language for a multi-platform future. Where XML is the powerful model for content from meta-data to books, XQuery is the application language that unlocks the potential of this content to build content applications to deliver content to multiple formats.
With MarkLogic's search extensions (which anticipate the additions to the standard) XQuery also becomes a search platform to power applicaitons. Unlike a search engine which can only point to the content, XQuery can search, manipulate and render the content all in one system.
This lets you build full applicaitons on one platform. For instance, as the Jim Pretin (the author of the article) suggests, a dating site.
If you the data for the dating site was modeled in XML that looked something like this:
<singles>
<person>
<name>Peter</name>
<sex>male</sex>
<age>32</age>
<interests>golf, skiing, camping, gazing at the stars</interests>
</person>
<person>
<name>Jane</name>
<sex>female</sex>
<age>27</age>
<interests>skiing, swimming, horseback riding</interests>
</person>
<person>
<name>Fred</name>
<sex>male</sex>
<age>32</age>
<interests>golf, football, car racing</interests>
</person>
</singles>
XQuery would let you perform the basic operations of searching for a date by matching conditions (a man over 30) and also let you do full text search against the content - say in the <interests> element where content is entered as free text:
for $person in input()/singles/person[./sex eq "male"][./age > 30][cts:contains(./interests, "gazing")]
return
<date>{$person/name}</date>*cts:contains() is a MarkLogic Server search built-in that lets you do full text search instead of the regex powered contains() in the current XQuery spec.
With this single function we get a potential date that is a male, over 30 and mentioned 'gazing' in his interests. We can then output this in any format - maybe an SMS or post to facebook or some simple XML:
<date>
<name>Peter</name>
</date>
We can do this all in one language - yup XQuery is powerful stuff and certainly, as the article points out, the right tool for a multi-platform future.
But there is just one little problem with the article . . . it keeps appearing over and over and over.
At first I thought it was a mistake - maybe I was rereading the same google alert twice? But then it just kept coming, sometimes two and three times in a single alert, sometimes with different titles (XQuery the Search Language of Tomorrow), but always there - a constant companion in my google alert.
So it looks like Jim Pretin (who runs a service called forms4free that will "GUARANTEE you a working form") is actually much more interested in spotting trendy keywords and spamming the world with content than actually promoting XQuery.
And he's quite good - check out this link from page FIVE (!) of a google search for the article.
But, all in all, this makes me pretty happy. XQuery is now a buzzword worth spending who knows how much time replicating content around the internet to get search hits!
Just another milestone for XQuery:
Standard (check!)
Powerful search and query across loads of content (check!)
Powers innovative content applications (check!)
Internet buzzword (check!)
Yes, we have truly arrived!
Comments