From john.snelson at oracle.com Tue Jan 6 15:14:41 2009 From: john.snelson at oracle.com (John Snelson) Date: Tue Jan 6 07:15:33 2009 Subject: [xquery-talk] [Announce] XQilla 2.2.0 released Message-ID: <49637561.6030209@oracle.com> The XQilla developers are pleased to announce the release of XQilla 2.2.0. This release adds a debugger and debugging API, partial support for XSLT 2.0, and a prototype implementation of higher order functions for XQuery. XQilla is an XQuery, XSLT 2.0 and XPath 2.0 implementation written in C++ and based on Xerces-C. It implements the DOM 3 XPath API, as well as having it's own more powerful API. It conforms to both the XQuery and XPath 2.0 W3C recommendations. The XSLT 2.0 work in XQilla is an ongoing effort, and should be considered alpha quality. Although it is possible to run a number of complex transformations there are significant features missing from the implementation, including xsl:include, xsl:import, xsl:output, xsl:result-document, and xsl:sort. If there are any developers interested in helping complete the XSLT 2.0 support, please get in touch with us at xqilla-devel@lists.sourceforge.net. XQilla can be downloaded here: http://sourceforge.net/project/showfiles.php?group_id=152021 More information on XQilla is available here: http://xqilla.sourceforge.net/HomePage -- John Snelson, Oracle Corporation Berkeley DB XML: http://www.oracle.com/database/berkeley-db/xml XQilla: http://xqilla.sourceforge.net From lists at fgeorges.org Sat Jan 10 21:23:27 2009 From: lists at fgeorges.org (Florent Georges) Date: Sat Jan 10 12:36:33 2009 Subject: [xquery-talk] Is It Time for EXSLT 2? Message-ID: <237931.68377.qm@web23003.mail.ird.yahoo.com> Hi, Kurt Cagle wrote an interesting blog post about a standard library of XQuery functions, EXQuery.org, kind of EXSLT for XQuery: http://broadcast.oreilly.com/2009/01/is-it-time-for-an-exqueryorg.html Some of us on XSL List thought the same thing about XSLT 2.0 for a while, and we recently began new discussions on the EXSLT list about a new version for XSLT 2.0. Actually, most of the extensions would be XPath 2.0 extension functions, and I believe most of them could be shared by XSLT 2.0 and XQuery (and maybe other plain XPath 2.0 engines.) As I explain in a comment on that blog post, I think it would be beneficial for both XSLT 2.0 and XQuery communities to join the same effort. I would be interested to hear the XQuery community thoughts regarding EXSLT2. For more info about EXSLT2, please see the EXSLT mailing list at http://lists.fourthought.com/mailman/listinfo/exslt and the wiki at http://www.fgeorges.org/exslt2-wiki/. Regards, -- Florent Georges http://www.fgeorges.org/ From c_z90 at yahoo.com Tue Jan 13 10:24:46 2009 From: c_z90 at yahoo.com (Charlie) Date: Tue Jan 13 10:23:48 2009 Subject: [xquery-talk] saxon uses collection as input Message-ID: <164365.95120.qm@web30105.mail.mud.yahoo.com> hi, I am using saxon9 command line java net.sf.saxon.Query, which supports '-s initialFile' option to provide initial context document. Is there a way to specify a collection of xml files to be the option, like file:///tmp/order*.xml, or file:///tmp?select=order*.xml? thanks, charlie From c_z90 at yahoo.com Tue Jan 13 10:32:29 2009 From: c_z90 at yahoo.com (Charlie) Date: Tue Jan 13 10:31:29 2009 Subject: [xquery-talk] saxon uses collection as input Message-ID: <479130.2690.qm@web30104.mail.mud.yahoo.com> hi, I am using saxon9 command line java net.sf.saxon.Query, which supports '-s initialFile'option to provide initial context document. Is there a way to specify a collection of xml files to be the option, like file:///tmp/order*.xml, or file:///tmp?select=order*.xml? thanks, charlie From andrew.j.welch at gmail.com Tue Jan 13 19:29:46 2009 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue Jan 13 11:28:46 2009 Subject: [xquery-talk] saxon uses collection as input In-Reply-To: <164365.95120.qm@web30105.mail.mud.yahoo.com> References: <164365.95120.qm@web30105.mail.mud.yahoo.com> Message-ID: <74a894af0901131129w4241d239o1c83283eebc20f80@mail.gmail.com> Supply the path as a string, then use the collection() function from within the query 2009/1/13 Charlie : > hi, > > I am using saxon9 command line java > net.sf.saxon.Query, which supports '-s initialFile' > option to provide initial context document. > > Is there a way to specify a collection of xml files to > be the option, like file:///tmp/order*.xml, or > file:///tmp?select=order*.xml? > > thanks, > charlie > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From kevin at kevingrover.net Wed Jan 14 21:15:24 2009 From: kevin at kevingrover.net (Kevin Grover) Date: Wed Jan 14 21:15:14 2009 Subject: [xquery-talk] Saxon 9.1.0.5 command ignoring method=text ? Message-ID: <4dd6a8f00901142115r64e7fc1bk48aed092387fb78d@mail.gmail.com> I'm using declare namespace saxon = "http://saxon.sf.net/"; declare option saxon:output "method=text"; and I'm still getting the xml declaration. I also tried adding declare option saxon:output "omit-xml-declaration=yes"; and no joy. However, adding '!method=text' to the command line works. I did some googling and notices that this occured between 8.4 and 8.5, but 'was going to be fixed soon'. What am I missing? Thanks - Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090114/8742b013/attachment.htm From andrew.j.welch at gmail.com Thu Jan 15 08:06:12 2009 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Thu Jan 15 00:06:01 2009 Subject: [xquery-talk] Saxon 9.1.0.5 command ignoring method=text ? In-Reply-To: <4dd6a8f00901142115r64e7fc1bk48aed092387fb78d@mail.gmail.com> References: <4dd6a8f00901142115r64e7fc1bk48aed092387fb78d@mail.gmail.com> Message-ID: <74a894af0901150006u2f5cde47jc9395d256038767f@mail.gmail.com> Can you provide a small, complete runnable example which demonstrates the problem? For example, does this do it: declare namespace saxon = "http://saxon.sf.net/"; declare option saxon:output "method=text"; 'a' Also run it with the -t option which will show you which version of Saxon you are using. cheers andrew 2009/1/15 Kevin Grover : > I'm using > > declare namespace saxon = "http://saxon.sf.net/"; > declare option saxon:output "method=text"; > > and I'm still getting the xml declaration. > > I also tried adding > > declare option saxon:output "omit-xml-declaration=yes"; > > and no joy. > > However, adding '!method=text' to the command line works. I did some > googling and notices that this occured between 8.4 and 8.5, but 'was going > to be fixed soon'. > > What am I missing? > > Thanks > > - Kevin > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From mike at saxonica.com Thu Jan 15 09:57:40 2009 From: mike at saxonica.com (Michael Kay) Date: Thu Jan 15 01:57:29 2009 Subject: [xquery-talk] Saxon 9.1.0.5 command ignoring method=text ? In-Reply-To: <4dd6a8f00901142115r64e7fc1bk48aed092387fb78d@mail.gmail.com> References: <4dd6a8f00901142115r64e7fc1bk48aed092387fb78d@mail.gmail.com> Message-ID: <1FF34F58E64B43CDA49ED921C3FF620F@Sealion> Saxon-specific questions are best asked on the saxon-help mailing list or forum (find them via the saxon project on sourceforge.net). I can't reproduce this problem from the information given. How are you running the query? Michael Kay http://www.saxonica.com/ _____ From: talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] On Behalf Of Kevin Grover Sent: 15 January 2009 05:15 To: talk@x-query.com Subject: [xquery-talk] Saxon 9.1.0.5 command ignoring method=text ? I'm using declare namespace saxon = "http://saxon.sf.net/"; declare option saxon:output "method=text"; and I'm still getting the xml declaration. I also tried adding declare option saxon:output "omit-xml-declaration=yes"; and no joy. However, adding '!method=text' to the command line works. I did some googling and notices that this occured between 8.4 and 8.5, but 'was going to be fixed soon'. What am I missing? Thanks - Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090115/940ada39/attachment.htm From kevin at kevingrover.net Thu Jan 15 17:43:38 2009 From: kevin at kevingrover.net (Kevin Grover) Date: Thu Jan 15 17:41:46 2009 Subject: [xquery-talk] Saxon 9.1.0.5 command ignoring method=text ? In-Reply-To: <74a894af0901150006u2f5cde47jc9395d256038767f@mail.gmail.com> References: <4dd6a8f00901142115r64e7fc1bk48aed092387fb78d@mail.gmail.com> <74a894af0901150006u2f5cde47jc9395d256038767f@mail.gmail.com> Message-ID: <4dd6a8f00901151743h5bc62dc6x9bc37ecc32c1c527@mail.gmail.com> Sorry, mea culpa: even though I looked and looked and looked, I didn't look hard enough: I had the namespace URL incorrect. I had an extra /. It all works was expected. Of course, I figured this out trying to come up with a minimal example. I should have done that up front, but the machine I was using was not connected to the Internet and I only had limited access to it. Sorry for the false report. On Thu, Jan 15, 2009 at 12:06 AM, Andrew Welch wrote: > Can you provide a small, complete runnable example which demonstrates > the problem? For example, does this do it: > > declare namespace saxon = "http://saxon.sf.net/"; > declare option saxon:output "method=text"; > > 'a' > > Also run it with the -t option which will show you which version of > Saxon you are using. > > cheers > andrew > > > 2009/1/15 Kevin Grover : > > I'm using > > > > declare namespace saxon = "http://saxon.sf.net/"; > > declare option saxon:output "method=text"; > > > > and I'm still getting the xml declaration. > > > > I also tried adding > > > > declare option saxon:output "omit-xml-declaration=yes"; > > > > and no joy. > > > > However, adding '!method=text' to the command line works. I did some > > googling and notices that this occured between 8.4 and 8.5, but 'was > going > > to be fixed soon'. > > > > What am I missing? > > > > Thanks > > > > - Kevin > > > > > > _______________________________________________ > > talk@x-query.com > > http://x-query.com/mailman/listinfo/talk > > > > > > -- > Andrew Welch > http://andrewjwelch.com > Kernow: http://kernowforsaxon.sf.net/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090115/377f1401/attachment.htm From adam.retter at googlemail.com Sat Jan 17 16:14:07 2009 From: adam.retter at googlemail.com (Adam Retter) Date: Sat Jan 17 08:14:01 2009 Subject: [xquery-talk] Is It Time for EXSLT 2? In-Reply-To: <237931.68377.qm@web23003.mail.ird.yahoo.com> References: <237931.68377.qm@web23003.mail.ird.yahoo.com> Message-ID: I came to a similar conclusion at the XML Prague 2007 conference after speaking with fellow eXist developers about a number of XQuery extension modules that I had added to eXist (some of which are described here - http://www.exist-db.org/extensions.html). Like Kurt my main thoughts were of avoiding vendor lock-in when developing XQuery applications and providing an open standard similar to that of the existing exslt.org. For that reason I purchased a number of domain names which I intended to use initially as a discussion for such a standard and later as a place to publish a possible standard. I hoped to collaborate with interested parties and developers of the leading XML databases in defining and establishing this standard. Unfortunately due to personal commitments in the last 18 months I have been short of free time and not much has progressed, however I now have some spare time available again. The previously mentioned exquery.org is one of the domains that I registered and I would be happy for this to be used (with the others) to publish a collaborative open standard for extensions to XQuery. So, how to get the ball rolling, who would like to be involved and the best way to collaborate on such an effort? Thanks Adam. {Subjective disclaimer - I am a developer on the eXist XML Native Database}. 2009/1/10 Florent Georges : > Hi, > > Kurt Cagle wrote an interesting blog post about a standard library > of XQuery functions, EXQuery.org, kind of EXSLT for XQuery: > > http://broadcast.oreilly.com/2009/01/is-it-time-for-an-exqueryorg.html > > Some of us on XSL List thought the same thing about XSLT 2.0 for a > while, and we recently began new discussions on the EXSLT list about > a new version for XSLT 2.0. Actually, most of the extensions would > be XPath 2.0 extension functions, and I believe most of them could > be shared by XSLT 2.0 and XQuery (and maybe other plain XPath 2.0 > engines.) > > As I explain in a comment on that blog post, I think it would be > beneficial for both XSLT 2.0 and XQuery communities to join the same > effort. I would be interested to hear the XQuery community thoughts > regarding EXSLT2. > > For more info about EXSLT2, please see the EXSLT mailing list at > http://lists.fourthought.com/mailman/listinfo/exslt and the wiki at > http://www.fgeorges.org/exslt2-wiki/. > > Regards, > > -- > Florent Georges > http://www.fgeorges.org/ > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- Adam Retter From hrennau at yahoo.de Tue Jan 20 07:46:48 2009 From: hrennau at yahoo.de (Hans-Juergen Rennau) Date: Mon Jan 19 23:45:05 2009 Subject: [xquery-talk] XQuery and Item Orientation Message-ID: <180209.60608.qm@web27102.mail.ukl.yahoo.com> Hello People, I would like to learn about your thoughts about a perspective of introducing "item orientation" - an echo of object orientation - into XQuery. Starting point: in my opinion, software development has undergone two revolutions: object orientation, and XML/XPath/XQuery, both acting as reducers of complexity. Suddenly it appears strange to me that XQuery makes no attempt to incorporate object oriented features. More concretely, I think of binding functionality to a) type and b) instance. Imagine a second kind of function were introduced into the language, call it itemFunction, which is invoked like an object's member function, where the "object" is an item: $triangle->rotate() or $triangles/.->rotate() Within the function body, the item is available as the context item expression (its top level uses, of course). So much for the binding to an instance. Now the binding to a type. This amounts to some sort of test used to select the appropriate function definition for a given item. An obvious possibility were to bind function declarations to an item type which must be matched by the item on which the function is invoked, for example thus: declare itemFunction element(tringle) local:rotate() {...} declare itemFunction element(square, squareType) local:rotate() {...} More flexibility is gained by the additional possibility to specify an item test in the form of an XPath expression: declare itemFunction element(), itemTest="@geometrical eq true()" element(tringle, triangleType) local:rotate() {...} To demonstrate the simplicity to be gained, imagine the task to edit a sequence of reports for rendering purposes. You might write $reports/.->render() and start with a default implementation of the itemFunction 'render'. Later, you refine the rendering by simply *adding* special versions, and you can even do so by just importing additional modules. My questions to you: - would such extensions of XQuery be desirable (from the user's point of view) - would such extensions introduce drawbacks or problems (from the implementor's point of view) Thank you for any comments! Hans-Juergen Rennau From mike at saxonica.com Tue Jan 20 08:50:12 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 20 00:48:34 2009 Subject: [xquery-talk] XQuery and Item Orientation In-Reply-To: <180209.60608.qm@web27102.mail.ukl.yahoo.com> References: <180209.60608.qm@web27102.mail.ukl.yahoo.com> Message-ID: What you're proposing isn't that far removed from XSLT's pattern matching capability. And of course as any XSLT user knows, this kind of polymorphic despatch mechanism is extremely valuable in dealing with data whose structure is variable. Of course XSLT's patterns are more flexible than what you are proposing, because they match against arbitrary predicates, not only against the type hierarchy - again, that's needed because of the variety of ways in which people express structural relationships in XML. The XQuery designers have been very opposed to any kind of dynamic despatch or polymorphism, because it makes many kinds of static optimization impossible. In this sense, the language is optimized for the large database environment where user convenience has to be sacrificed to the needs of performance. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Hans-Juergen Rennau > Sent: 20 January 2009 07:47 > To: talk@x-query.com > Subject: [xquery-talk] XQuery and Item Orientation > > Hello People, > > I would like to learn about your thoughts about a perspective > of introducing "item orientation" - an echo of object > orientation - into XQuery. > > Starting point: in my opinion, software development has > undergone two revolutions: object orientation, and > XML/XPath/XQuery, both acting as reducers of complexity. > Suddenly it appears strange to me that XQuery makes no > attempt to incorporate object oriented features. More > concretely, I think of binding functionality to a) type and > b) instance. Imagine a second kind of function were > introduced into the language, call it itemFunction, which is > invoked like an object's member function, where the "object" > is an item: > $triangle->rotate() > or > $triangles/.->rotate() > > Within the function body, the item is available as the > context item expression (its top level uses, of course). So > much for the binding to an instance. Now the binding to a > type. This amounts to some sort of test used to select the > appropriate function definition for a given item. An obvious > possibility were to bind function declarations to an item > type which must be matched by the item on which the function > is invoked, for example thus: > declare itemFunction element(tringle) local:rotate() {...} > declare itemFunction element(square, squareType) > local:rotate() {...} > > More flexibility is gained by the additional possibility to > specify an item test in the form of an XPath expression: > declare itemFunction element(), itemTest="@geometrical eq true()" > element(tringle, triangleType) local:rotate() {...} > > To demonstrate the simplicity to be gained, imagine the task > to edit a sequence of reports for rendering purposes. You might write > $reports/.->render() > > and start with a default implementation of the itemFunction > 'render'. Later, you refine the rendering by simply *adding* > special versions, and you can even do so by just importing > additional modules. > > My questions to you: > - would such extensions of XQuery be desirable (from the > user's point of view) > - would such extensions introduce drawbacks or problems (from > the implementor's point of view) > > Thank you for any comments! > Hans-Juergen Rennau > > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From gfourny at inf.ethz.ch Tue Jan 20 11:33:25 2009 From: gfourny at inf.ethz.ch (Ghislain Fourny) Date: Tue Jan 20 02:31:43 2009 Subject: [xquery-talk] XQuery and Item Orientation Message-ID: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> Hello, First, as an XQuery user (but this is only my opinion), object orientation (or as you call it item-orientation) is a feature which I would appreciate to have in XQuery. Here are a couple of words regarding implementation. In my research group, we are actually working on a project about object orientation in XQuery, called Unity. We did not go into dynamic binding or polymorphism, but basically, we simply tried to introduce code in the schema to allow constructs like, following your idea: $triangle/rotate() where the context item is passed as a hidden parameter to the method rotate. The method rotate is defined in the schema for the static type of $triangle. To put code in the schema, we added "classes" to the XQuery syntax. A class is simply a complex type definition written in (a text-version of) XML Schema, containing, in addition to elements and attributes, also methods. In these methods, unlike in (most) XQuery functions, the context item is defined. Of course, an alternative way would be to really use XML Schema in its original XML format and define methods separately in an XQuery file. For example, a complex type containing code could be defined with code like: declare class HanoiProblem { element numOfTowers as xs:positiveInteger occurs 1-1; (: we did not reinvent the wheel, this is just a text version of XML Schema (here, implicitely a sequence) :) element src as xs:string occurs 1-1; element aux as xs:string occurs 1-1; element dst as xs:string occurs 1-1; method solution() { solve(getTowers(), src, aux, dst) } method solve($n as xs:integer, $src as xs:string, $aux as xs:string, $dst as xs:string) { if ($n eq 0) then () else ( solve($n -1, $src, $dst, $aux), move($src, $dst), solve($n -1, $aux, $src, $dst) ) } method move($src as xs:string,$dest as xs:string) { {$src} {$dest} } method getTowers() as xs:integer{ numOfTowers } }; And it could be used with code like: let $hanoiProblemInstance as element(my:HanoiProblem) := fn:doc("hanoi.xml")/my:hanoi let $n := $hanoiProblemInstance/my:getTowers() let $solution := {$hanoiProblemInstance/ my:solution()} return $solution We have implemented a cross-compiler which compiles Unity code to XQuery+XML Schema, and could test the output successfully with Saxon SA on several examples. We did not encounter any major issues during the implementation. One issue could be a name collision between a method and a function, which can be solved by looking at methods for the static type of the context item first, and then at functions. We are now thinking of adding this functionality to an existing schema- aware XQuery engine to see how it performs. Of course I would also be happy to hear comments on object-orientation in XQuery. Perhaps other research groups are also working on this topic? Kind regards, Ghislain Fourny -----Original Message----- From: talk...@x-query.com [mailto:talk...@x-query.com] On Behalf Of Hans-Juergen Rennau Sent: 20 January 2009 07:47 To: ta...@x-query.com Subject: [xquery-talk] XQuery and Item Orientation Hello People, I would like to learn about your thoughts about a perspective of introducing "item orientation" - an echo of object orientation - into XQuery. Starting point: in my opinion, software development has undergone two revolutions: object orientation, and XML/XPath/XQuery, both acting as reducers of complexity. Suddenly it appears strange to me that XQuery makes no attempt to incorporate object oriented features. More concretely, I think of binding functionality to a) type and b) instance. Imagine a second kind of function were introduced into the language, call it itemFunction, which is invoked like an object's member function, where the "object" is an item: $triangle->rotate() or $triangles/.->rotate() Within the function body, the item is available as the context item expression (its top level uses, of course). So much for the binding to an instance. Now the binding to a type. This amounts to some sort of test used to select the appropriate function definition for a given item. An obvious possibility were to bind function declarations to an item type which must be matched by the item on which the function is invoked, for example thus: declare itemFunction element(tringle) local:rotate() {...} declare itemFunction element(square, squareType) local:rotate() {...} More flexibility is gained by the additional possibility to specify an item test in the form of an XPath expression: declare itemFunction element(), itemTest="@geometrical eq true()" element(tringle, triangleType) local:rotate() {...} To demonstrate the simplicity to be gained, imagine the task to edit a sequence of reports for rendering purposes. You might write $reports/.->render() and start with a default implementation of the itemFunction 'render'. Later, you refine the rendering by simply *adding* special versions, and you can even do so by just importing additional modules. My questions to you: - would such extensions of XQuery be desirable (from the user's point of view) - would such extensions introduce drawbacks or problems (from the implementor's point of view) Thank you for any comments! Hans-Juergen Rennau _______________________________________________ ta...@x-query.com http://x-query.com/mailman/listinfo/talk _______________________________________________ ta...@x-query.com http://x-query.com/mailman/listinfo/talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090120/e1f841fb/attachment.htm From mike at saxonica.com Tue Jan 20 18:19:39 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Jan 20 10:20:21 2009 Subject: [xquery-talk] XQuery and Item Orientation In-Reply-To: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> References: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> Message-ID: In my research group, we are actually working on a project about object orientation in XQuery, called Unity. We did not go into dynamic binding or polymorphism, but basically, we simply tried to introduce code in the schema to allow constructs like, following your idea: $triangle/rotate() where the context item is passed as a hidden parameter to the method rotate. The method rotate is defined in the schema for the static type of $triangle. I don't think static polymorphism (overloading based on the static type of the arguments - here the implicit first argument) - is a particularly useful step forwards. It gives a minor syntactic convenience for the kind of highly structured data where static typing works, but the real need is for something more dynamic. I'm all in favour of allowing a function to declare that it takes the context item as an implicit parameter, but that's just a bit of syntactic sugar. We have implemented a cross-compiler which compiles Unity code to XQuery+XML Schema, and could test the output successfully with Saxon SA on several examples. We did not encounter any major issues during the implementation. One issue could be a name collision between a method and a function, which can be solved by looking at methods for the static type of the context item first, and then at functions. I think that if you are despatching different methods based on the results of static type inferencing, then the static type rules need to be visible to, and comprehensible to, the users of the language. That isn't the case with Saxon's current static typing, which is designed for optimization and diagnostics only - it shouldn't affect the result of the query, so it's done as intelligently as Saxon considers appropriate. I would be very concerned about "freezing" the static typing rules in such a way that a change to make it more clever could affect the results of user queries. Michael Kay http://www.saxonica.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090120/c6c5b70e/attachment-0001.htm From gfourny at inf.ethz.ch Wed Jan 21 00:38:08 2009 From: gfourny at inf.ethz.ch (Ghislain Fourny) Date: Tue Jan 20 15:38:46 2009 Subject: [xquery-talk] XQuery and Item Orientation In-Reply-To: References: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> Message-ID: <97E88AAF-D930-4F17-BAAF-F3F9008025BD@inf.ethz.ch> Hello, I totally agree with you that this is a rather minor step forward, but as a programmer, I really value the possibility to have a way to structure a program in modules and classes if the data is highly structured: it makes the code easier to understand and it makes it easier to build big applications. This is one step towards encapsulation, without removing the ability of XQuery to deal with unstructured data. But this might be simply a matter of taste and of programming style, so this is somehow subjective. Regarding static typing and Saxon: we do not use Saxon for the static typing which determines which method is executed. Instead, we perform a very basic and well-defined static typing on complex types based on explicit type declarations and on the imported schema. Saxon SA is only used to execute the compiled output, in which the method has already been bound. So if you make changes to your optimisations, this will not affect the result of the queries. Kind regards, Ghislain Fourny > > In my research group, we are actually working on a project about > object orientation in XQuery, called Unity. We did not go into > dynamic binding or polymorphism, but basically, we simply tried to > introduce code in the schema to allow constructs like, following > your idea: > > $triangle/rotate() > > where the context item is passed as a hidden parameter to the method > rotate. The method rotate is defined in the schema for the static > type of $triangle. > > I don't think static polymorphism (overloading based on the static > type of the arguments - here the implicit first argument) - is a > particularly useful step forwards. It gives a minor syntactic > convenience for the kind of highly structured data where static > typing works, but the real need is for something more dynamic. > I'm all in favour of allowing a function to declare that it takes > the context item as an implicit parameter, but that's just a bit of > syntactic sugar. > We have implemented a cross-compiler which compiles Unity code to > XQuery+XML Schema, and could test the output successfully with Saxon > SA on several examples. We did not encounter any major issues during > the implementation. One issue could be a name collision between a > method and a function, which can be solved by looking at methods for > the static type of the context item first, and then at functions. > > I think that if you are despatching different methods based on the > results of static type inferencing, then the static type rules need > to be visible to, and comprehensible to, the users of the language. > That isn't the case with Saxon's current static typing, which is > designed for optimization and diagnostics only - it shouldn't affect > the result of the query, so it's done as intelligently as Saxon > considers appropriate. I would be very concerned about "freezing" > the static typing rules in such a way that a change to make it more > clever could affect the results of user queries. > > Michael Kay > http://www.saxonica.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090121/f4a9af25/attachment.htm From brian at blumenfeld-maso.com Tue Jan 20 20:11:18 2009 From: brian at blumenfeld-maso.com (Brian Maso) Date: Tue Jan 20 20:10:47 2009 Subject: [xquery-talk] XQuery and Item Orientation In-Reply-To: <97E88AAF-D930-4F17-BAAF-F3F9008025BD@inf.ethz.ch> References: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> <97E88AAF-D930-4F17-BAAF-F3F9008025BD@inf.ethz.ch> Message-ID: I'm a language slut as much as anyone, but I feel like this territory has been covered. I think initially of Cu (.Net platform), a language that has XML, relational, and OO structures all as first-class citizens. I like that XQuery has tight focus -- I think of it as a functional DSL for processing XML, and that's a great thing. (Adding functions as first-class types would really kick ass, though!) But adding "methods" to XSD types? Eh (shrug). Brian Maso On Tue, Jan 20, 2009 at 3:38 PM, Ghislain Fourny wrote: > Hello, > > I totally agree with you that this is a rather minor step forward, but as a > programmer, I really value the possibility to have a way to structure a > program in modules and classes if the data is highly structured: it makes > the code easier to understand and it makes it easier to build big > applications. This is one step towards encapsulation, without removing the > ability of XQuery to deal with unstructured data. But this might be simply a > matter of taste and of programming style, so this is somehow subjective. > > Regarding static typing and Saxon: we do not use Saxon for the static > typing which determines which method is executed. Instead, we perform a very > basic and well-defined static typing on complex types based on explicit type > declarations and on the imported schema. Saxon SA is only used to execute > the compiled output, in which the method has already been bound. So if you > make changes to your optimisations, this will not affect the result of the > queries. > > Kind regards, > Ghislain Fourny > > > > In my research group, we are actually working on a project about object > orientation in XQuery, called Unity. We did not go into dynamic binding or > polymorphism, but basically, we simply tried to introduce code in the schema > to allow constructs like, following your idea: > > $triangle/rotate() > > where the context item is passed as a hidden parameter to the method > rotate. The method rotate is defined in the schema for the static type of > $triangle. > > I don't think static polymorphism (overloading based on the static type of > the arguments - here the implicit first argument) - is a particularly useful > step forwards. It gives a minor syntactic convenience for the kind of highly > structured data where static typing works, but the real need is for > something more dynamic. > > I'm all in favour of allowing a function to declare that it takes the > context item as an implicit parameter, but that's just a bit of syntactic > sugar. > We have implemented a cross-compiler which compiles Unity code to > XQuery+XML Schema, and could test the output successfully with Saxon SA on > several examples. We did not encounter any major issues during the > implementation. One issue could be a name collision between a method and a > function, which can be solved by looking at methods for the static type of > the context item first, and then at functions. > > I think that if you are despatching different methods based on the results > of static type inferencing, then the static type rules need to be visible > to, and comprehensible to, the users of the language. That isn't the case > with Saxon's current static typing, which is designed for optimization and > diagnostics only - it shouldn't affect the result of the query, so it's done > as intelligently as Saxon considers appropriate. I would be very concerned > about "freezing" the static typing rules in such a way that a change to make > it more clever could affect the results of user queries. > > Michael Kay > http://www.saxonica.com/ > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090120/36e9db47/attachment.htm From john.snelson at oracle.com Wed Jan 21 11:26:56 2009 From: john.snelson at oracle.com (John Snelson) Date: Wed Jan 21 03:26:40 2009 Subject: [xquery-talk] XQuery and Item Orientation In-Reply-To: References: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> <97E88AAF-D930-4F17-BAAF-F3F9008025BD@inf.ethz.ch> Message-ID: <49770680.60801@oracle.com> Brian Maso wrote: > I like that XQuery has tight focus -- I think of it as a functional DSL > for processing XML, and that's a great thing. (Adding functions as > first-class types would really kick ass, though!) But adding "methods" > to XSD types? Eh (shrug). Of course once you have first-class functions, you can do object oriented programming anyway. :-) John -- John Snelson, Oracle Corporation http://snelson.org.uk/john Berkeley DB XML: http://oracle.com/database/berkeley-db/xml XQilla: http://xqilla.sourceforge.net From matthew at stickledown.com Wed Jan 21 12:07:12 2009 From: matthew at stickledown.com (Matthew Rawlings) Date: Wed Jan 21 04:06:36 2009 Subject: [xquery-talk] defining Schema in XQuery Message-ID: Out of interest, why did the XQuery WG not permit the definition of Schema within XQuery? The WG gave us curly braces representation of XML, but no curly braces definition of XML Schema. Often I wish to write some snippets of Schema for use solely within an XQuery module for typing intermediate results. It would be very useful to permit the definition of Schema in curly braces inside XQuery, in the same way we can for XML. - Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090121/54b6145b/attachment-0001.htm From stefan.majewski at univie.ac.at Wed Jan 21 14:03:26 2009 From: stefan.majewski at univie.ac.at (Stefan Majewski) Date: Wed Jan 21 05:03:32 2009 Subject: [xquery-talk] Omission in near() when used in mixed content Message-ID: <49771D1E.7050206@univie.ac.at> Dear all, we are currently seeing Problems with near() when used with words span over element boundaries. We have a fulltext index with content="mixed" defined for the collection. We know that the index as such works, as near() works as expected with single words, even when they overlap element tags. Nevertheless when searching for a succession of multiple words the search fails if at least one of the words is split by an element. Assume the following xql: --- declare namespace tei = "http://www.tei-c.org/ns/1.0"; let $q := "mixed test" return //tei:u[near(. , $q)] --- and this sample document: ---
this the first mixed test this the second mixed test this is the third mixed test this is last mixed test
--- several searches yield very different results, even though they should imho be equal 1) $q="mixed" returns tei:u with id u1,u2,u3,u4 2) $2="mixed test" only returns tei:u with id u3,u4 Does anybody see a different behaviour? I might have misinterpreted something in the docs, such that the assumption that the second search should return the same four tei:u elements is wrong, or maybe there could also be a bug in near() or the fulltext index causing this issue. However it might be, I would be very glad to get some hints how I could circumvent this issue as I currently implement searches over highly segmented texts. cheers, Stefan From stefan.majewski at univie.ac.at Wed Jan 21 14:07:35 2009 From: stefan.majewski at univie.ac.at (Stefan Majewski) Date: Wed Jan 21 05:07:42 2009 Subject: [xquery-talk] Re: Omission in near() when used in mixed content In-Reply-To: <49771D1E.7050206@univie.ac.at> References: <49771D1E.7050206@univie.ac.at> Message-ID: <49771E17.9050808@univie.ac.at> sorry, picked the wrong list, best Stefan From dsewell at virginia.edu Wed Jan 21 10:09:47 2009 From: dsewell at virginia.edu (David Sewell) Date: Wed Jan 21 07:09:52 2009 Subject: [xquery-talk] Omission in near() when used in mixed content In-Reply-To: <49771D1E.7050206@univie.ac.at> References: <49771D1E.7050206@univie.ac.at> Message-ID: On Wed, 21 Jan 2009, Stefan Majewski wrote: > we are currently seeing Problems with near() when used with words span > over element boundaries. [...] Someone else will respond to the question, but I have a small suggestion: in this case near() is not a standard XQuery function but an eXist extension function, and it will be helpful to readers of this list to give an indication at the start of a message that you are talking about a particular dialect of XQuery and not general XQuery 1.0. Otherwise you may confuse people who think there is some function fn:near() that they don't know about. Davi S. -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 801079, Charlottesville, VA 22904-4318 USA Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903 Email: dsewell@virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From hrennau at yahoo.de Thu Jan 22 06:58:56 2009 From: hrennau at yahoo.de (Hans-Juergen Rennau) Date: Wed Jan 21 22:58:54 2009 Subject: [xquery-talk] [AW] XQuery and Item Orientation Message-ID: <500928.43856.qm@web27106.mail.ukl.yahoo.com> *** Retry of a previous mail - according to a bounce mail parts of it had been lost *** *** Sorry for any inconvenience *** Yes, the proposed item orientation is very closely related to XSLT's pattern matching. But I want to emphasize a difference of perspective: XSLT's polymorphism does not breathe object-orientation. It is meant for, as you put it, "dealing with data whose structure is variable", it is less appropriate for creating interfaces whose abstraction hides the variability of concrete behaviour. I perceive templates in the first place as a mechanism for uniform triggering of variable processing - trigger it and get it done. Just compare the ease of using a function call within an expression with the cumbersome voodoo required for catching a template's output and make it input for further processing! I am just trying to say that polymorphic functions would introduce something into X-technology that XSLT's templates do not well cover: the possibility to create "abstract" applications based on abstract functionality, to be extended by concrete (function) implementations in order to become a runnable application. An example. Consider a tool for evaluating logfiles based on a conceptual framework which views the data as grouped into named domains and within domains into types, allowing further differentiation by judging the relationships between a given log event to system entities. Domains, type-defining keys, relationship judgments - all can be specified in terms of XPath expressions or simple XQuery functions. This framework allows the design of sophisticated applications which are structurally independent of the actual choices of names, paths and functions. Polymorphic functions would be very helpful to *implement* such applications, ready to be extended by the missing function implementations (here yielding names, paths and judgments) in order to become a running application. Perhaps the point of view depends on whether one regards XQuery as a query language or as a data processing language with superb query capabilities. With kind regards - Hans-Juergen Rennau ----- Urspr?ngliche Mail ---- Von: Michael Kay An: Hans-Juergen Rennau ; talk@x-query.com Gesendet: Dienstag, den 20. Januar 2009, 00:50:12 Uhr Betreff: RE: [xquery-talk] XQuery and Item Orientation What you're proposing isn't that far removed from XSLT's pattern matching capability. And of course as any XSLT user knows, this kind of polymorphic despatch mechanism is extremely valuable in dealing with data whose structure is variable. Of course XSLT's patterns are more flexible than what you are proposing, because they match against arbitrary predicates, not only against the type hierarchy - again, that's needed because of the variety of ways in which people express structural relationships in XML. The XQuery designers have been very opposed to any kind of dynamic despatch or polymorphism, because it makes many kinds of static optimization impossible. In this sense, the language is optimized for the large database environment where user convenience has to be sacrificed to the needs of performance. Michael Kay http://www.saxonica.com/ From mike at saxonica.com Thu Jan 22 09:24:40 2009 From: mike at saxonica.com (Michael Kay) Date: Thu Jan 22 01:24:37 2009 Subject: [xquery-talk] RE: [AW] XQuery and Item Orientation In-Reply-To: <500928.43856.qm@web27106.mail.ukl.yahoo.com> References: <500928.43856.qm@web27106.mail.ukl.yahoo.com> Message-ID: <3DCBA15201204EDF9A5B16D374BA6B29@Sealion> > XSLT's polymorphism does not breathe object-orientation. It > is meant for, as you put it, "dealing with data whose > structure is variable", it is less appropriate for creating > interfaces whose abstraction hides the variability of > concrete behaviour. I perceive templates in the first place > as a mechanism for uniform triggering of variable processing > - trigger it and get it done. Just compare the ease of using > a function call within an expression with the cumbersome > voodoo required for catching a template's output and make it > input for further processing! I agree with all that: but you can use XSLT's templates to achieve this kind of thing if you choose to. For example etc. Providing a function as an interface to a set of templates in this way eliminates all the voodoo as far as the caller is concerned. In XSLT 2.1 we're hoping to get some more modularity/encapsulation into this so you can declare, for example, that the mode is private to a module and the function is public. > I am just trying to say that polymorphic functions would > introduce something into X-technology that XSLT's templates > do not well cover: I agree that XQuery desperately needs some kind of polymorphism, but I'm not convinced that the traditional type hierarchy of object-oriented systems maps well to the XML world as the basis for despatching. Patterns with user-defined priority give more flexibility. Michael Kay http://www.saxonica.com/ From hrennau at yahoo.de Thu Jan 22 22:38:07 2009 From: hrennau at yahoo.de (Hans-Juergen Rennau) Date: Thu Jan 22 14:38:35 2009 Subject: [xquery-talk] AW: [AW] XQuery and Item Orientation References: <500928.43856.qm@web27106.mail.ukl.yahoo.com> <3DCBA15201204EDF9A5B16D374BA6B29@Sealion> Message-ID: <863774.55724.qm@web27103.mail.ukl.yahoo.com> Thank you for pointing to this technique of emulating polymorphic functions in XSLT ? very nice. And the direction XSLT is heading seems very promising to me. I emphatically agree with your statement that not type hierarchy but patterns (or general XPath expressions ? test expressions) should be the basis of polymorphism. As the discussions have helped to further clarify my thoughts, I would like to propose a new summing up of ?item orientation?. a) Starting point: object orientation is more than a mechanism of dispatch ? rather a way of thought, influencing the way we model systems, because it influences the conceptual units we combine into systems. The introduction of object orientation means to gain a new modeling perspective. b) Item orientation can be viewed as *projection* of object orientation to the plane of XML data. Projection in the sense of: keep what you can, and discard what you cannot. The main loss comes by mapping a function in the broad sense of programming languages to an XQuery function with its intrinsic limitation of ?no side effects!?. This is a loss, and still the mapping makes sense: object => item member function => item function, that is, function with implicit access to the item?s data member function?s polymorphism based on type hierarchy and type-interface relationships => item function?s polymorphism based on competing match conditions object interface => all functions that can be bound to the given item class interface => a set of functions which happen to have the same match conditions When it comes to the class interface, the mapping is deliberately lightweight in order to preserve the phantastic agility and interoperability which the uniform data model (six kinds of nodes, three kinds of node relationship) offers; arguably, a need to explicitly define ?interfaces? or ?classes? might comprise them. With kind regards ? Hans-J?ergen Rennau ----- Urspr?ngliche Mail ---- Von: Michael Kay An: Hans-Juergen Rennau CC: talk@x-query.com Gesendet: Donnerstag, den 22. Januar 2009, 01:24:40 Uhr Betreff: RE: [AW] XQuery and Item Orientation > XSLT's polymorphism does not breathe object-orientation. It > is meant for, as you put it, "dealing with data whose > structure is variable", it is less appropriate for creating > interfaces whose abstraction hides the variability of > concrete behaviour. I perceive templates in the first place > as a mechanism for uniform triggering of variable processing > - trigger it and get it done. Just compare the ease of using > a function call within an expression with the cumbersome > voodoo required for catching a template's output and make it > input for further processing! I agree with all that: but you can use XSLT's templates to achieve this kind of thing if you choose to. For example etc. Providing a function as an interface to a set of templates in this way eliminates all the voodoo as far as the caller is concerned. In XSLT 2.1 we're hoping to get some more modularity/encapsulation into this so you can declare, for example, that the mode is private to a module and the function is public. > I am just trying to say that polymorphic functions would > introduce something into X-technology that XSLT's templates > do not well cover: I agree that XQuery desperately needs some kind of polymorphism, but I'm not convinced that the traditional type hierarchy of object-oriented systems maps well to the XML world as the basis for despatching. Patterns with user-defined priority give more flexibility. Michael Kay http://www.saxonica.com/ From dave.pawson at gmail.com Fri Jan 23 18:40:20 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Fri Jan 23 10:41:16 2009 Subject: [xquery-talk] xquery cheat sheet Message-ID: <711a73df0901231040m5097ed66t659283499ab4ac02@mail.gmail.com> I've started an 'xquery cheat cheat', a quick reference for syntax. http://www.dpawson.co.uk/xquery/xpath-functions.html for the functions. PDF to follow. Looking at http://www.w3.org/TR/xquery/ I'm less certain what would be 'handy' as a reference? BNF? Definitions? Suggestions please TIA -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From Geert.Josten at daidalos.nl Fri Jan 23 23:12:39 2009 From: Geert.Josten at daidalos.nl (Geert Josten) Date: Fri Jan 23 14:13:37 2009 Subject: [xquery-talk] xquery cheat sheet In-Reply-To: <711a73df0901231040m5097ed66t659283499ab4ac02@mail.gmail.com> Message-ID: <0260356C6DFE754BA6FA48E659A1433823E3C31833@Helios.olympus.borgus.nl> I lately use the FunctX Xquery ref a lot, which contains both rec functions as well as usefull precoded additional functions. (http://www.datypic.com/xq/) For syntax I have used the BNF part the most.. Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Dave Pawson > Sent: vrijdag 23 januari 2009 19:40 > To: xquery-discuss > Subject: [xquery-talk] xquery cheat sheet > > I've started an 'xquery cheat cheat', > a quick reference for syntax. > http://www.dpawson.co.uk/xquery/xpath-functions.html for > the functions. PDF to follow. > > Looking at http://www.w3.org/TR/xquery/ > I'm less certain what would be 'handy' as a reference? > BNF? Definitions? > Suggestions please > > TIA > > -- > Dave Pawson > XSLT XSL-FO FAQ. > Docbook FAQ. > http://www.dpawson.co.uk > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From james.fuller.2007 at gmail.com Fri Jan 23 23:21:00 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Fri Jan 23 14:21:52 2009 Subject: [xquery-talk] xquery cheat sheet In-Reply-To: <711a73df0901231040m5097ed66t659283499ab4ac02@mail.gmail.com> References: <711a73df0901231040m5097ed66t659283499ab4ac02@mail.gmail.com> Message-ID: Chris Wallace's XQuery wikibooks effort is good http://en.wikibooks.org/wiki/XQuery and you might find some gems here http://en.wikibooks.org/wiki/XQuery/Gotchas or http://en.wikibooks.org/wiki/XQuery/Ahhas cheers, Jim Fuller On Fri, Jan 23, 2009 at 7:40 PM, Dave Pawson wrote: > I've started an 'xquery cheat cheat', > a quick reference for syntax. > http://www.dpawson.co.uk/xquery/xpath-functions.html for the > functions. PDF to follow. > > Looking at http://www.w3.org/TR/xquery/ > I'm less certain what would be 'handy' as a reference? > BNF? Definitions? > Suggestions please > > TIA > > -- > Dave Pawson > XSLT XSL-FO FAQ. > Docbook FAQ. > http://www.dpawson.co.uk > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From dave.pawson at gmail.com Sat Jan 24 07:37:37 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Fri Jan 23 23:38:29 2009 Subject: [xquery-talk] xquery cheat sheet In-Reply-To: <0260356C6DFE754BA6FA48E659A1433823E3C31833@Helios.olympus.borgus.nl> References: <711a73df0901231040m5097ed66t659283499ab4ac02@mail.gmail.com> <0260356C6DFE754BA6FA48E659A1433823E3C31833@Helios.olympus.borgus.nl> Message-ID: <711a73df0901232337i72323800q6e327b1cb2c86d7a@mail.gmail.com> 2009/1/23 Geert Josten : > I lately use the FunctX Xquery ref a lot, which contains both rec functions as well as usefull precoded additional functions. (http://www.datypic.com/xq/) > > For syntax I have used the BNF part the most.. Thanks Geert. I'll start with BNF, see what I'm missing later :-) regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From dave.pawson at gmail.com Sat Jan 24 09:04:35 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sat Jan 24 01:05:26 2009 Subject: [xquery-talk] xquery cheat sheet In-Reply-To: <711a73df0901232337i72323800q6e327b1cb2c86d7a@mail.gmail.com> References: <711a73df0901231040m5097ed66t659283499ab4ac02@mail.gmail.com> <0260356C6DFE754BA6FA48E659A1433823E3C31833@Helios.olympus.borgus.nl> <711a73df0901232337i72323800q6e327b1cb2c86d7a@mail.gmail.com> Message-ID: <711a73df0901240104k7effe63clfc99359a8cf3ee0@mail.gmail.com> 2009/1/24 Dave Pawson : > 2009/1/23 Geert Josten : >> I lately use the FunctX Xquery ref a lot, which contains both rec functions as well as usefull precoded additional functions. (http://www.datypic.com/xq/) >> >> For syntax I have used the BNF part the most.. > > > Thanks Geert. > I'll start with BNF, see what I'm missing later :-) Just the EBNF and definitions. http://www.dpawson.co.uk/xquery/xquery.html regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From dave.pawson at gmail.com Sat Jan 24 11:45:57 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sat Jan 24 03:46:49 2009 Subject: [xquery-talk] Linking Saxon through to exist database Message-ID: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> I've installed exist and using it's sandbox its working fine. Can I connect a query to that database and use Saxon for the query engine? http://localhost:8080/exist is the http endpoint. http://en.wikibooks.org/wiki/XQuery/Searching_multiple_collections shows using let $col-a := '/db/test/a' which is clearly incorrect for the file protocol? How to translate that into the http address please? Anyone been there and done that? TIA -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From wolfgang at exist-db.org Sat Jan 24 13:06:04 2009 From: wolfgang at exist-db.org (Wolfgang) Date: Sat Jan 24 04:06:56 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> Message-ID: <497B042C.6030300@exist-db.org> > I've installed exist and using it's sandbox its working fine. Since this is a product specific question, it should probably be discussed on the eXist mailing list. Anyway ... > Can I connect a query to that database and use > Saxon for the query engine? > > http://localhost:8080/exist is the http endpoint. > > http://en.wikibooks.org/wiki/XQuery/Searching_multiple_collections > shows using let $col-a := '/db/test/a' > which is clearly incorrect for the file protocol? You can access documents via HTTP using e.g. http://localhost:8080/exist/rest/db/test/a/books.xml Using this link within e.g. an XSLT will be ok (though not efficient for larger docs). BUT: collections are a different matter since different XQuery implementations use different concepts of what consitutes a collection. http://localhost:8080/exist/rest/db/test/a returns an XML fragment listing the collection contents. If you really need to, you could pre-process that somehow to include all collection member documents. But as I said, it might not be very efficient. Wolfgang From dave.pawson at gmail.com Sat Jan 24 12:24:10 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sat Jan 24 04:25:00 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <497B042C.6030300@exist-db.org> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <497B042C.6030300@exist-db.org> Message-ID: <711a73df0901240424o2706888ct5b2f105ce84f686a@mail.gmail.com> 2009/1/24 Wolfgang : >> I've installed exist and using it's sandbox its working fine. > > Since this is a product specific question, it should probably be discussed > on the eXist mailing list. Anyway ... Cross product? :-) > You can access documents via HTTP using e.g. > > http://localhost:8080/exist/rest/db/test/a/books.xml wget on http://localhost:8080/exist/rest/db/books/a works fine here. Using Saxon I get Error XPTY0019: Required item type of first operand of '/' is node(); supplied value has item type xs:string Static error(s) in query (no indication on line number so I'm not sure if its' the let or the for statement in error.) for let $a := 'http://localhost:8080/exist/rest/db/books/a' return { for $book in $a//book return $book } where 'books' is the collection. -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From mpilman at student.ethz.ch Sat Jan 24 13:35:33 2009 From: mpilman at student.ethz.ch (Markus Pilman) Date: Sat Jan 24 04:36:23 2009 Subject: [xquery-talk] RE: [AW] XQuery and Item Orientation In-Reply-To: <3DCBA15201204EDF9A5B16D374BA6B29@Sealion> References: <500928.43856.qm@web27106.mail.ukl.yahoo.com> <3DCBA15201204EDF9A5B16D374BA6B29@Sealion> Message-ID: <60f8b5ce0901240435o316af88at2429bb54ae053632@mail.gmail.com> > I agree that XQuery desperately needs some kind of polymorphism, but I'm not > convinced that the traditional type hierarchy of object-oriented systems > maps well to the XML world as the basis for despatching. But when I look at the proposed solution by Unity, I have the following impressions: 1. I like the idea of human readable schema very much! Although XQuery was designed to handle unstructured data (and it is good at it), most of my data I handle with XQuery is structured or, at least, semi-structured. But writing XML Schema is pain and importing and using it in XQuery is not intuitive at all. With the use of classes, this problems would go away. 2.) The possibility, that a function takes implicitly the context as the first argument is, as said before, "just" syntactic sugar. But for me, this would be a big step forward: I really like sugar :-) With these to features, there are only two of the big main concepts of object orientation missing (did not think too long about it - so it's possible that I miss something): information hiding and dynamic binding. I think information hiding would be a problem, but what is wrong about defining a "virtual" keyword for functions? Of course, this will affect performance, but this is an acceptable price, regarding the benefits we would get with such a feature. I think it is a question, about which use cases we talk: on a database I do not need these features. But in application programming, this would make a lot of sense. Writing a web application in Unity seems to me to be more comfortable than in XQuery. On Thu, Jan 22, 2009 at 10:24 AM, Michael Kay wrote: >> XSLT's polymorphism does not breathe object-orientation. It >> is meant for, as you put it, "dealing with data whose >> structure is variable", it is less appropriate for creating >> interfaces whose abstraction hides the variability of >> concrete behaviour. I perceive templates in the first place >> as a mechanism for uniform triggering of variable processing >> - trigger it and get it done. Just compare the ease of using >> a function call within an expression with the cumbersome >> voodoo required for catching a template's output and make it >> input for further processing! > > I agree with all that: but you can use XSLT's templates to achieve this kind > of thing if you choose to. > > For example > > > > > > > > > > > > > > > etc. Providing a function as an interface to a set of templates in this way > eliminates all the voodoo as far as the caller is concerned. In XSLT 2.1 > we're hoping to get some more modularity/encapsulation into this so you can > declare, for example, that the mode is private to a module and the function > is public. > >> I am just trying to say that polymorphic functions would >> introduce something into X-technology that XSLT's templates >> do not well cover: > > I agree that XQuery desperately needs some kind of polymorphism, but I'm not > convinced that the traditional type hierarchy of object-oriented systems > maps well to the XML world as the basis for despatching. Patterns with > user-defined priority give more flexibility. > > Michael Kay > http://www.saxonica.com/ > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From wolfgang at exist-db.org Sat Jan 24 13:35:49 2009 From: wolfgang at exist-db.org (Wolfgang) Date: Sat Jan 24 04:36:40 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <711a73df0901240424o2706888ct5b2f105ce84f686a@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <497B042C.6030300@exist-db.org> <711a73df0901240424o2706888ct5b2f105ce84f686a@mail.gmail.com> Message-ID: <497B0B25.8010705@exist-db.org> >> You can access documents via HTTP using e.g. >> >> http://localhost:8080/exist/rest/db/test/a/books.xml > > wget on http://localhost:8080/exist/rest/db/books/a works fine here. Ok, but since books/a is a collection, you should get a collection listing: > Error > XPTY0019: Required item type of first operand of '/' is node(); > supplied value has item > type xs:string > Static error(s) in query You forgot to actually load the document using doc(): let $a := 'http://localhost:8080/exist/rest/db/test/a/books.xml' return { for $book in doc($a)//book return $book } Wolfgang From andrew.j.welch at gmail.com Sat Jan 24 14:02:38 2009 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Sat Jan 24 06:03:30 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> Message-ID: <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> Hi Dave, 2009/1/24 Dave Pawson : > I've installed exist and using it's sandbox its working fine. > > Can I connect a query to that database and use > Saxon for the query engine? No - you have to use eXist's query engine to benefit from the database. Using Saxon as the query engine and talking to eXist through its rest interface effectively just treats as a filestore (unless you're calling an xquery to return you some nodes, but there's not much point in using Saxon and eXist in that case??) Is that what you meant? -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From dave.pawson at gmail.com Sat Jan 24 15:23:00 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sat Jan 24 07:23:51 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> Message-ID: <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> 2009/1/24 Andrew Welch : >> Can I connect a query to that database and use >> Saxon for the query engine? > > No - you have to use eXist's query engine to benefit from the > database. Using Saxon as the query engine and talking to eXist > through its rest interface effectively just treats as a filestore > (unless you're calling an xquery to return you some nodes, but there's > not much point in using Saxon and eXist in that case??) > > Is that what you meant? My simple logic. XSLT isn't very good at big files. An xml database should be better. Saxon provides an xquery interface. Why can't I use the two together? Yes, selecting nodes from an xml file or collection of files in the exist database is the goal. It did work with the exist REST interface.... can you explain a bit better what you mean by treating exist as a filestore? ... What else is exist? Sounds like I'm missing another api into exist? The "smart" one? I'd prefer Saxon since the exist xquery implementation seems incomplete according to the documentation? I guess I'm missing something Andrew? regards > > -- > Andrew Welch > http://andrewjwelch.com > Kernow: http://kernowforsaxon.sf.net/ > -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From andrew.j.welch at gmail.com Sat Jan 24 16:00:44 2009 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Sat Jan 24 08:01:30 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> Message-ID: <74a894af0901240800lbfa206cge640c70901dc8802@mail.gmail.com> > My simple logic. > XSLT isn't very good at big files. > An xml database should be better. Yes, hopefully not too far away from XSLT being good at big files too :) > Saxon provides an xquery interface. > Why can't I use the two together? It would need to know about eXist's underlying data model, how to use its indexes etc > Yes, selecting nodes from an xml file or collection of files > in the exist database is the goal. > > It did work with the exist REST interface.... can you > explain a bit better what you mean by treating exist > as a filestore? ... What else is exist? ok, for example you have 10,000 xml file of 1mb each stored in eXist - if each doc had a element you could get all of them by doing //title and this would be very fast as eXist has indexed all the elements etc. If you were using Saxon and going through the REST interface you would have to either: - get each individual document through say the doc() function (so the xml may as well just be on your filesystem) - write a query in eXist that gets all the title elements and returns well-formed xml, and then hit that with the doc() function from Saxon. This is good, however eXist will build and serialise the intermediate tree which Saxon will then reparse... (and you also have to code to that intermediate tree rather than the data itself) > Sounds like I'm missing another api into exist? > The "smart" one? Just write your xquery in eXist... I'd only use Saxon for XSLT 2.0 -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ From dave.pawson at gmail.com Sat Jan 24 16:24:51 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sat Jan 24 08:25:42 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <74a894af0901240800lbfa206cge640c70901dc8802@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> <74a894af0901240800lbfa206cge640c70901dc8802@mail.gmail.com> Message-ID: <711a73df0901240824g43e0d22du1f4b60dcc0126631@mail.gmail.com> 2009/1/24 Andrew Welch <andrew.j.welch@gmail.com>: >> My simple logic. >> Saxon provides an xquery interface. >> Why can't I use the two together? > > It would need to know about eXist's underlying data model, how to use > its indexes etc OK, makes sense. Tks >> It did work with the exist REST interface.... can you >> explain a bit better what you mean by treating exist >> as a filestore? ... What else is exist? > > ok, for example you have 10,000 xml file of 1mb each stored in eXist - > if each doc had a <title> element you could get all of them by doing > > //title > > and this would be very fast as eXist has indexed all the elements etc. > > If you were using Saxon and going through the REST interface you would > have to either: > > - get each individual document through say the doc() function (so the > xml may as well just be on your filesystem) > > - write a query in eXist that gets all the title elements and returns > well-formed xml, and then hit that with the doc() function from Saxon. > This is good, however eXist will build and serialise the intermediate > tree which Saxon will then reparse... (and you also have to code to > that intermediate tree rather than the data itself) > > >> Sounds like I'm missing another api into exist? >> The "smart" one? > > Just write your xquery in eXist... I'd only use Saxon for XSLT 2.0 OK. Thanks Andrew. Next question, how to use emacs and a cli interface to exist. I'll go poke about. TTFN Saxon. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From liam at w3.org Sat Jan 24 12:42:40 2009 From: liam at w3.org (Liam Quin) Date: Sat Jan 24 09:42:33 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> Message-ID: <20090124174240.GD25058@w3.org> On Sat, Jan 24, 2009 at 03:23:00PM +0000, Dave Pawson wrote: > My simple logic. > XSLT isn't very good at big files. > An xml database should be better. Often they are. On my Web site I use qizx or saxon right now, with prototypes using qizx with a database, or dbxml also with a database. But my "big" files are all under 50 MBytes. > Saxon provides an xquery interface. > Why can't I use the two together? "Lorries are good for carrying freight. But a porsche is nicer to drive. Why can't I use the porsche to pull my truck? :-) ;-) > I'd prefer Saxon since the exist xquery implementation > seems incomplete according to the documentation? I don't know how complete it is -- I admit I tend to use qizx rather than exist -- but if you stick with XQuery and avoid extensions as much as possible, you can easily experiment with moving between different implementations and see which one(s) you like best :-) Liam -- Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/ http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/ From dave.pawson at gmail.com Sat Jan 24 18:04:22 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sat Jan 24 10:04:13 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <20090124174240.GD25058@w3.org> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> <20090124174240.GD25058@w3.org> Message-ID: <711a73df0901241004u61abf458rf0cc9c9c8e8e7dc9@mail.gmail.com> You get everywhere Liam :-) 2009/1/24 Liam Quin <liam@w3.org>: > "Lorries are good for carrying freight. But a porsche is > nicer to drive. Why can't I use the porsche to pull my > truck? :-) ;-) 'cos ..... Fair point. Always struck me that XSLT usage ranges over v.large to v.small. > >> I'd prefer Saxon since the exist xquery implementation >> seems incomplete according to the documentation? > > I don't know how complete it is -- I admit I tend to > use qizx rather than exist http://www.rpbourret.com/xml/ProdsNative.htm#qizx >From xmlmind? -- but if you stick with > XQuery and avoid extensions as much as possible, > you can easily experiment with moving between different > implementations and see which one(s) you like best :-) Good point. We know Mike sticks to the rec. Thanks Liam. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From rob at koberg.com Sat Jan 24 13:35:20 2009 From: rob at koberg.com (Robert Koberg) Date: Sat Jan 24 10:35:12 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <20090124174240.GD25058@w3.org> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> <20090124174240.GD25058@w3.org> Message-ID: <3920403F-B0A2-4E0B-9336-F6377B5E7FDB@koberg.com> On Jan 24, 2009, at 12:42 PM, Liam Quin wrote: > On Sat, Jan 24, 2009 at 03:23:00PM +0000, Dave Pawson wrote: >> My simple logic. >> XSLT isn't very good at big files. >> An xml database should be better. > > Often they are. On my Web site I use qizx or saxon right now, > with prototypes using qizx with a database, or dbxml also > with a database. But my "big" files are all under 50 MBytes. > >> Saxon provides an xquery interface. >> Why can't I use the two together? > > "Lorries are good for carrying freight. But a porsche is > nicer to drive. Why can't I use the porsche to pull my > truck? :-) ;-) This isn't a fair comparison. How about this: It would seem like there are people (standard XQuery instructions) driving multiple trucks (processors) built to the same standard. When you hook it up to the same trailer (a hierarchical set of collections/folders that contain documents), the thing you are pulling turns out to be different. At this point I am not even talking about extension functions that basically do the same thing in each processor, but live in different namespaces. (And really, how many people in the real world write only standards based XQuery?) -Rob > > >> I'd prefer Saxon since the exist xquery implementation >> seems incomplete according to the documentation? > > I don't know how complete it is -- I admit I tend to > use qizx rather than exist -- but if you stick with > XQuery and avoid extensions as much as possible, > you can easily experiment with moving between different > implementations and see which one(s) you like best :-) > > Liam > > -- > Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/ > http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/ > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Sat Jan 24 19:36:09 2009 From: mike at saxonica.com (Michael Kay) Date: Sat Jan 24 11:36:00 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> Message-ID: <074012BF493B4054BA3FF0A8F9EF8AC2@Sealion> > > I've installed exist and using it's sandbox its working fine. > > Can I connect a query to that database and use Saxon for the > query engine? > Only if you want to treat eXist as a simple substitute for a filestore containing XML documents that can be retrieved by name/URI. You can do that, but the performance is going to be very similar to what you get when the documents are actually in filestore - or possibly worse. You're not going to see Saxon decomposing your query (or XPath expression) and shipping parts of it to eXist to take advantage of eXist's indexes, or to retrieve only the parts of the documents that your expression actually needs. That's not because it's technically infeasible, but because it's a pretty sophisticated piece of technology that would cost a lot to develop and test and would be priced correspondingly. The DataDirect XQuery engine does this kind of query decomposition to access data from multiple data sources, but as far as I know it currently accesses only relational back-end databases and XML in filestore, not XML databases. I'm sure the technology is quite capable of accessing an XML data source, but the cost of integrating each supported data source is likely to be high. Michael Kay http://www.saxonica.com/ From gfourny at inf.ethz.ch Sat Jan 24 20:39:51 2009 From: gfourny at inf.ethz.ch (Ghislain Fourny) Date: Sat Jan 24 11:39:44 2009 Subject: [xquery-talk] RE: [AW] XQuery and Item Orientation In-Reply-To: <60f8b5ce0901240435o316af88at2429bb54ae053632@mail.gmail.com> References: <500928.43856.qm@web27106.mail.ukl.yahoo.com> <3DCBA15201204EDF9A5B16D374BA6B29@Sealion> <60f8b5ce0901240435o316af88at2429bb54ae053632@mail.gmail.com> Message-ID: <F026CFBE-2C4E-459C-982C-601445A05F58@inf.ethz.ch> Hello, I think that it is an important point that the relevance of object- orientation features in XQuery depends on the use cases. Everybody (I think) agrees that XQuery is very efficient and well-suited to process XML/relational data: it was designed exactly for this. The question here seems to be: can XQuery do more, e.g., do what Java/C++ do -- without reducing performance on pure XML processing -- and would this be desirable at all? My feeling is that XQuery has a considerable potential. As Hans- Juergen Rennau mentioned it earlier, XQuery/XML/XPath was one of two major revolutions in software development, the other being object- oriented programming, and so I am also wondering: would it not be nice and useful if one were able to design a seamless (i.e., XML nodes and objects are "the same") solution cumulating the best sides of both XML Querying and Object-orientation in a single language? Would not XQuery be a good match for this? The mapping suggested by Hans-Juergen Rennau following Michael Kay's comment about patterns with user-defined priority (as an alternative to type hierarchies for polymorphism) is interesting. I have questions regarding this: with this approach, what kind of control would an implementor/a user have about which function is called when? How would this affect predictability of program execution and debugging? Does XQuery not already have some kind of type-hierarchy-based polymorphism (the recommendation says in 3.1.5. (Function Calls) "the rules for SequenceType Matching permit a value of a derived type to be substituted for a value of its base type")? Kind regards and thanks a lot for your interesting comments, Ghislain Fourny > > > I think it is a question, about which use cases we talk: on a database > I do not need these features. But in application programming, this > would make a lot of sense. Writing a web application in Unity seems to > me to be more comfortable than in XQuery. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090124/ecd9ddbe/attachment-0001.htm From gfourny at inf.ethz.ch Sat Jan 24 21:29:49 2009 From: gfourny at inf.ethz.ch (Ghislain Fourny) Date: Sat Jan 24 12:29:41 2009 Subject: [xquery-talk] XQuery and Item Orientation In-Reply-To: <dcc7a340901202011tbca14fdx4463bf06d3c4dc70@mail.gmail.com> References: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> <F68F073A0CED4F069735DFFB55A16CD9@Sealion> <97E88AAF-D930-4F17-BAAF-F3F9008025BD@inf.ethz.ch> <dcc7a340901202011tbca14fdx4463bf06d3c4dc70@mail.gmail.com> Message-ID: <4B4A9E4F-4FB9-4FBB-86D1-4C7E05D0C845@inf.ethz.ch> Hello, Are you refering to C Omega? It is an interesting approach, thanks for pointing this out. What I am wondering is: how does it compare to start with object- orientation (here, C#) and add XML/Querying capabilities, versus to start with XML/XQuery and add object/item-orientation? In terms of expressiveness as well as performance? Kind regards, Ghislain Fourny > I think initially of Cu (.Net platform), a language that has XML, > relational, and OO structures all as first-class citizens. > From brian at blumenfeld-maso.com Sat Jan 24 13:01:45 2009 From: brian at blumenfeld-maso.com (Brian Maso) Date: Sat Jan 24 13:01:35 2009 Subject: [xquery-talk] XQuery and Item Orientation In-Reply-To: <4B4A9E4F-4FB9-4FBB-86D1-4C7E05D0C845@inf.ethz.ch> References: <0D2C76E6-E9BE-414C-832E-DA3AEE9BB8F0@inf.ethz.ch> <F68F073A0CED4F069735DFFB55A16CD9@Sealion> <97E88AAF-D930-4F17-BAAF-F3F9008025BD@inf.ethz.ch> <dcc7a340901202011tbca14fdx4463bf06d3c4dc70@mail.gmail.com> <4B4A9E4F-4FB9-4FBB-86D1-4C7E05D0C845@inf.ethz.ch> Message-ID: <dcc7a340901241301j36090b5eg177385057785e194@mail.gmail.com> 1) C Omega's name is bizarro -- technically it is "C-<lower-case-omega>", which looks more or less like "Cw" when you try to make something like it in latin letters. "Cw" is of course unpronounceable, so many people refer to it as "Cu". (C Omega tops C# for poorly-conveived name. Google didn't index on the "#" character when C# was originally released, so searching for "C#" in Google originally yielded nothing. "C-<lower-case-omega>" yields even less.) 2) I really have no knowledge of relative performance/expressiveness of the language approaches you are asking about. I must admit I am intigued by the idea of polymorphism based on XPath pattern -- its kind of like ML/Scala pattern matching on steriods I guess -- I'm hoping you will go forward with it a bit and we can see where it leads! Brian Maso On Sat, Jan 24, 2009 at 12:29 PM, Ghislain Fourny <gfourny@inf.ethz.ch>wrote: > Hello, > > Are you refering to C Omega? It is an interesting approach, thanks for > pointing this out. > > What I am wondering is: how does it compare to start with > object-orientation (here, C#) and add XML/Querying capabilities, versus to > start with XML/XQuery and add object/item-orientation? In terms of > expressiveness as well as performance? > > Kind regards, > Ghislain Fourny > > I think initially of Cu (.Net platform), a language that has XML, >> relational, and OO structures all as first-class citizens. >> >> > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090124/fd4fe45e/attachment.htm From rob at koberg.com Sat Jan 24 16:56:47 2009 From: rob at koberg.com (Robert Koberg) Date: Sat Jan 24 13:56:37 2009 Subject: [xquery-talk] RE: [AW] XQuery and Item Orientation In-Reply-To: <F026CFBE-2C4E-459C-982C-601445A05F58@inf.ethz.ch> References: <500928.43856.qm@web27106.mail.ukl.yahoo.com> <3DCBA15201204EDF9A5B16D374BA6B29@Sealion> <60f8b5ce0901240435o316af88at2429bb54ae053632@mail.gmail.com> <F026CFBE-2C4E-459C-982C-601445A05F58@inf.ethz.ch> Message-ID: <8525603C-F276-4DFE-892E-94728FF237CA@koberg.com> On Jan 24, 2009, at 2:39 PM, Ghislain Fourny wrote: > Hello, > > I think that it is an important point that the relevance of object- > orientation features in XQuery depends on the use cases. Everybody > (I think) agrees that XQuery is very efficient and well-suited to > process XML/relational data: Depends on what you mean by process and if you meant relational data as XML (as opposed to mixed/article-like content). But, regardless, if you mean to query XML and filter/bring out pieces, then yes. If you mean to transform one representation to another, then no. -Rob From dave.pawson at gmail.com Sun Jan 25 08:50:50 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sun Jan 25 00:50:39 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <074012BF493B4054BA3FF0A8F9EF8AC2@Sealion> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <074012BF493B4054BA3FF0A8F9EF8AC2@Sealion> Message-ID: <711a73df0901250050u4479927cg1750ee6d8711925e@mail.gmail.com> 2009/1/24 Michael Kay <mike@saxonica.com>: >> Can I connect a query to that database and use Saxon for the >> query engine? >> > You're not going to see Saxon decomposing your query (or XPath expression) > and shipping parts of it to eXist to take advantage of eXist's indexes, or > to retrieve only the parts of the documents that your expression actually > needs. That's not because it's technically infeasible, but because it's a > pretty sophisticated piece of technology that would cost a lot to develop > and test and would be priced correspondingly. Andrew mentioned the data model as another factor. The sophisticated indexing (giving the speed hike) does make sense and a big difference. Any idea if W3C considered 'standardising' some part of this (no idea of this makes sense or not) to enable such a mix and match, or is that clearly in the implementation arena? > > The DataDirect XQuery engine does this kind of query decomposition to access > data from multiple data sources, but as far as I know it currently accesses > only relational back-end databases and XML in filestore, not XML databases. > I'm sure the technology is quite capable of accessing an XML data source, > but the cost of integrating each supported data source is likely to be high. And you'd need to do this for each XML datastore. Not really practical I guess. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From dave.pawson at gmail.com Sun Jan 25 13:35:24 2009 From: dave.pawson at gmail.com (Dave Pawson) Date: Sun Jan 25 05:36:11 2009 Subject: [xquery-talk] xquery cheat sheet. Rev 1 Message-ID: <711a73df0901250535w3980ab36s5e98e737c72e1c5d@mail.gmail.com> I've added the datatypes (seems the only definitive list is in the imagemap!) 3 files now, all linked from http://www.dpawson.co.uk/xquery/ Any errors are mine. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk From liam at w3.org Sun Jan 25 14:39:31 2009 From: liam at w3.org (Liam Quin) Date: Sun Jan 25 11:38:43 2009 Subject: [xquery-talk] Linking Saxon through to exist database In-Reply-To: <3920403F-B0A2-4E0B-9336-F6377B5E7FDB@koberg.com> References: <711a73df0901240345x5a1ff072i84de77f19e1f8678@mail.gmail.com> <74a894af0901240602p4d15b0b8t915b2dd58acf2912@mail.gmail.com> <711a73df0901240723kafed601uea56652c7a99488b@mail.gmail.com> <20090124174240.GD25058@w3.org> <3920403F-B0A2-4E0B-9336-F6377B5E7FDB@koberg.com> Message-ID: <20090125193930.GB29556@w3.org> On Sat, Jan 24, 2009 at 01:35:20PM -0500, Robert Koberg wrote: > On Jan 24, 2009, at 12:42 PM, Liam Quin wrote: > >On Sat, Jan 24, 2009 at 03:23:00PM +0000, Dave Pawson wrote: [...] > This isn't a fair comparison. It was an analogy, not a comparison, I wasn't trying to be fair :-) (maybe I should have mentioned that I also make heavy use of Saxon myself) > And really, how many people in the real world write only > standards based XQuery? A lot I hope. I don't know how to measure it, though. I don't think I've often used extension functions, although collection() and doc() vary between implementations. it depends what sort of thing you're doing -- I have always had a non-XQuery wrapper around my XQuery if it's on the Web. For example, http://www.fromoldbooks.org/Search/ uses a query "preamble" that's generated on the fly from incoming query parameters, and has been through some simple sanity checks. Some people do it through extensions and some don't, I expect, same as for XSLT. I'd like to see more standardisation of the fuzzy area around XQuery, e.g. how to get at query parameters (CGI for example), and some standard function libraries (image-dimensions, get-exif-as-xml, random-number, etc etc) but I admit I haven't written proposals... Anyway, we're probably meandering a bit off topic here :-) Thanks for replying, and sorry if my analogy was a little cononfusing. Liam -- Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/ http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/ From hrennau at yahoo.de Fri Jan 30 07:16:31 2009 From: hrennau at yahoo.de (Hans-Juergen Rennau) Date: Thu Jan 29 23:13:54 2009 Subject: [xquery-talk] XQuery and Item Orientation References: <200901241940.n0OJdxPE028841@jhunter.x-query.com> Message-ID: <217870.88176.qm@web27105.mail.ukl.yahoo.com> Hello Ghislain, you wrote: "The mapping ..(based on)... patterns with user-defined priority (as an alternative to type hierarchies for polymorphism) is interesting. I have questions regarding this: with this approach, what kind of control would an implementor/a user have about which function is called when? How would this affect predictability of program execution and debugging? Does XQuery not already have some kind of type-hierarchy-based polymorphism (the recommendation says in 3.1.5. (Function Calls) "the rules for SequenceType Matching permit a value of a derived type to be substituted for a value of its base type")? My suggestion to follow the approach taken by XML Schema 1.1 when selecting a type alternative - rather than the (powerful but less lucid) approach taken (for good reasons) by XSLT, that is: ~ XML Schema 1.1's type selection: "associate an ordered list of type alternatives with test expressions; the first match is taken!" ~ item orientation: "associate an ordered list of function variants with test expressions; the first match is taken!" (It is is a minor detail on how to organize this "list" of functions syntactically (explicitly, or implicitly by order of function declarations and imports.) The predictability would of course be the same as with XML Schema - total. But perhaps I should point out one difference between your approach and mine (if I understood you correctly): you chose to make any function call potentially an item function call, with the current context item providing the "candidate item". You wrote: $triangle/rotate() whereas I prefer to make item calls explicit: $triangle/.->rotate() This does play a role in terms of lucidity, dont't you think? With kind regards - Hans-Juergen Rennau ~~~~ Hello, I think that it is an important point that the relevance of object- orientation features in XQuery depends on the use cases. Everybody (I think) agrees that XQuery is very efficient and well-suited to process XML/relational data: it was designed exactly for this. The question here seems to be: can XQuery do more, e.g., do what Java/C++ do -- without reducing performance on pure XML processing -- and would this be desirable at all? My feeling is that XQuery has a considerable potential. As Hans- Juergen Rennau mentioned it earlier, XQuery/XML/XPath was one of two major revolutions in software development, the other being object- oriented programming, and so I am also wondering: would it not be nice and useful if one were able to design a seamless (i.e., XML nodes and objects are "the same") solution cumulating the best sides of both XML Querying and Object-orientation in a single language? Would not XQuery be a good match for this? The mapping suggested by Hans-Juergen Rennau following Michael Kay's comment about patterns with user-defined priority (as an alternative to type hierarchies for polymorphism) is interesting. I have questions regarding this: with this approach, what kind of control would an implementor/a user have about which function is called when? How would this affect predictability of program execution and debugging? Does XQuery not already have some kind of type-hierarchy-based polymorphism (the recommendation says in 3.1.5. (Function Calls) "the rules for SequenceType Matching permit a value of a derived type to be substituted for a value of its base type")? Kind regards and thanks a lot for your interesting comments, Ghislain Fourny ************************************ From yoshiokamoto at yahoo.com Fri Jan 30 19:29:08 2009 From: yoshiokamoto at yahoo.com (Yoshi Okamoto) Date: Fri Jan 30 19:26:19 2009 Subject: [xquery-talk] XQuery - Grammar? Implementations? Message-ID: <870712.23590.qm@web63102.mail.re1.yahoo.com> Dear XQuery subscribers, I am sometimes fighting to understand all the details of the XQuery grammar. If you have some time, I would be delighted if you could have a look at the following example: I have defined a function with a single string argument: [0] declare function local:f($a as xs:string) { $a }; If I pass on an element as follows: [1] let $a := <X>Y</X> return local:f($a) it is accepted by most XQuery implementations which I tried (I am testing with Saxon, BaseX, MonetDB, Zorba, Qizx, Kawa and MXQuery). However, when I cast the element before passing it on: [2] let $a as xs:string := <X>Y</X> return local:f($a) some implementations (also Saxon, which I regard as reference implementation) return [XPTY0004] as error. A third version with an explicit cast: [3] let $a := xs:string(<X>Y</X>) return local:f($a) is finally accepted by all implementations. If possible, can someone tell me what the difference are between the versions, especially [1] and [2]? I tried to find the answer in the specification, but I was not successful. Thank you very much for your attention and help! Best Regards, Yoshi Okamoto From rpbourret at rpbourret.com Fri Jan 30 21:59:03 2009 From: rpbourret at rpbourret.com (Ronald Bourret) Date: Fri Jan 30 21:56:10 2009 Subject: [xquery-talk] XQuery - Grammar? Implementations? In-Reply-To: <870712.23590.qm@web63102.mail.re1.yahoo.com> References: <870712.23590.qm@web63102.mail.re1.yahoo.com> Message-ID: <4983E8A7.9060303@rpbourret.com> Hello, [1] succeeds (correctly) because of the function conversion rules listed in section 3.1.5 (Function Calls). These "are used to convert an argument value or a return value to its expected type". The rule that applies to [1] is that, when a function argument has an atomic type, argument values are atomized. Atomization (section 2.4.2.) converts sequences of nodes to sequences of atomic values. For [1], the node value <X>Y</X> is converted to "Y". [2] fails (correctly) because $a is declared to be an xs:string and <X>Y</X> is not a string. Section 3.8.1 (For and Let Clauses) states the following in the 14th paragraph (not counting examples): "If the type of a value bound to the variable does not match the declared type according to the rules for SequenceType matching, a type error is raised [err:XPTY0004]" [3] succeeds correctly because casting explicitly converts <X>Y</X> to a string, which is the type expected by the function. Note that [3] does explicitly what [1] does implicitly. -- Ron Yoshi Okamoto wrote: > Dear XQuery subscribers, > > I am sometimes fighting to understand all the details of the XQuery grammar. If you have some time, I would be delighted if you could have a look at the following example: I have defined a function with a single string argument: > > [0] declare function local:f($a as xs:string) { $a }; > > If I pass on an element as follows: > > [1] let $a := <X>Y</X> return local:f($a) > > it is accepted by most XQuery implementations which I tried (I am testing with Saxon, BaseX, MonetDB, Zorba, Qizx, Kawa and MXQuery). However, when I cast the element before passing it on: > > [2] let $a as xs:string := <X>Y</X> return local:f($a) > > some implementations (also Saxon, which I regard as reference implementation) return [XPTY0004] as error. A third version with an explicit cast: > > [3] let $a := xs:string(<X>Y</X>) return local:f($a) > > is finally accepted by all implementations. > > If possible, can someone tell me what the difference are between the versions, especially [1] and [2]? I tried to find the answer in the specification, but I was not successful. > > Thank you very much for your attention and help! > > Best Regards, > Yoshi Okamoto > > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.233 / Virus Database: 270.10.16/1926 - Release Date: 1/30/2009 5:31 PM > From mike at saxonica.com Sat Jan 31 10:05:27 2009 From: mike at saxonica.com (Michael Kay) Date: Sat Jan 31 02:02:22 2009 Subject: [xquery-talk] XQuery - Grammar? Implementations? In-Reply-To: <870712.23590.qm@web63102.mail.re1.yahoo.com> References: <870712.23590.qm@web63102.mail.re1.yahoo.com> Message-ID: <BB32D7EB3EEB4ED2810FA2361A505E3F@Sealion> > > I am sometimes fighting to understand all the details of the > XQuery grammar. If you have some time, I would be delighted > if you could have a look at the following example: I have > defined a function with a single string argument: > > [0] declare function local:f($a as xs:string) { $a }; > > If I pass on an element as follows: > > [1] let $a := <X>Y</X> return local:f($a) > > it is accepted by most XQuery implementations which I tried > (I am testing with Saxon, BaseX, MonetDB, Zorba, Qizx, Kawa > and MXQuery). Yes, the function calling rules say that you atomize the element, which returns an untypedAtomic value, and in a function call untypedAtomic gets converted to string. However, when I cast the element before passing it on: > > [2] let $a as xs:string := <X>Y</X> return local:f($a) > > some implementations (also Saxon, which I regard as reference > implementation) return [XPTY0004] as error. There's no "cast" here, just a type declaration for the variable. Unfortunately, for reasons that I think are completely misguided, the rules for assigning to variables are different from the rules for supplying values to function parameters, and do not allow implicit atomization or conversion from untypedAtomic to string. A third version > with an explicit cast: > > [3] let $a := xs:string(<X>Y</X>) return local:f($a) > > is finally accepted by all implementations. Yes, in this case the element is implicitly atomized to untypedAtomic, and then the xs:string() constructor function does an explicit conversion. > > If possible, can someone tell me what the difference are > between the versions, especially [1] and [2]? I tried to find > the answer in the specification, but I was not successful. The difference is that XQuery does not use the function conversion rules when assigning to a variable, it insists that the value assigned to the variable should be precisely the type that is declared. (This differs from XSLT, where the function conversion rules are used in both cases.) Michael Kay http://www.saxonica.com/ From yoshiokamoto at yahoo.com Sat Jan 31 19:05:07 2009 From: yoshiokamoto at yahoo.com (Yoshi Okamoto) Date: Sat Jan 31 19:03:58 2009 Subject: [xquery-talk] XQuery - Grammar? Implementations? References: <870712.23590.qm@web63102.mail.re1.yahoo.com> <BB32D7EB3EEB4ED2810FA2361A505E3F@Sealion> Message-ID: <816852.40355.qm@web63108.mail.re1.yahoo.com> Dear Ron, dear Michael, thank you very much for your concern and your quick and concise answers; I think I fully understand the differences now. I am often wondering about XQuery. I never felt a need to read the specifications of Java, Python and similar languages - or SQL - but XQuery seems over-specified to me. The basic concepts are graceful - and this is a serious reason for me to use it - but there are so many sophisticated details and exceptions that you never know 100% what is going on. XSLT seems more straight-forward to me, but it is very tiresome to read. This might be a reason why many people stick with XPath and do further processing with other languages. Anyway, this is just my very personal opinion, resulting from limited experiences. I hope that no one feels offended. Thank you again, best wishes, Yoshi Okamoto