From mlu at as-guides.com Thu Apr 9 18:57:57 2009 From: mlu at as-guides.com (Michael Ludwig) Date: Thu Apr 9 08:56:45 2009 Subject: [xquery-talk] doc() function failing to load DTD Message-ID: <49DE1B05.2090902@as-guides.com> The XQuery implementation of an XML database fails to resolve the URI of the DTD specified in the SYSTEM identifier. dbxml> query { doc('file:/home/milu/xpg/xml/Sender.xml') } 1 objects returned for eager expression ' doc('file:/home/milu/xpg/xml/Sender.xml') ' dbxml> print &Sender; 3 &Gruppen; DTD loading attempted, but failing: dbxml> query { doc('file:/home/milu/xpg/xml/Sender.xml')/* } stdin:55: query failed, Error: XML Indexer: Fatal Parse error in document at line, 2, char 43. Parser message: An exception occurred! Type:RuntimeException, Message:Could not open DTD file 'Sender.dtd' Changing the URI to file:///home/milu/xpg/xml/Sender.xml doesn't help. The DTD is in the same directory as the document, and parsing the document from other contexts works fine. So I think the database engine should be able to retrieve it using the base URI of the document. Is this assumption correct? Michael Ludwig From gmf at maine.rr.com Thu Apr 9 15:58:13 2009 From: gmf at maine.rr.com (George Feinberg) Date: Thu Apr 9 11:56:53 2009 Subject: [xquery-talk] doc() function failing to load DTD In-Reply-To: <49DE1B05.2090902@as-guides.com> References: <49DE1B05.2090902@as-guides.com> Message-ID: <84F30D7F-4EC0-4D90-9F5B-D49D9EDD2767@maine.rr.com> Michael, Your issue is somewhat product-specific. In this case you are using Berkeley DB XML and it's dbxml shell program for testing. The problem is not the URI for the file but the file's reference to the DTD. BDB XML uses Xerces-C for parsing/validation and by default Xerces-C will look in the current directory for DTDs referenced by a relative pathname (e.g. "Sender.dtd"). If you change that to an absolute pathname or file: URI your query will succeed. In BDB XML you have another option if you write it into your program (vs using the dbxml shell). You can implement XmlResolver and resolve entities such as DTDs yourself. Regards, George On Apr 9, 2009, at 11:57 AM, Michael Ludwig wrote: > The XQuery implementation of an XML database fails to resolve the URI > of the DTD specified in the SYSTEM identifier. > > dbxml> query { doc('file:/home/milu/xpg/xml/Sender.xml') } > 1 objects returned for eager expression > ' doc('file:/home/milu/xpg/xml/Sender.xml') ' > > dbxml> print > > > > &Sender; > 3 > &Gruppen; > > > DTD loading attempted, but failing: > > dbxml> query { doc('file:/home/milu/xpg/xml/Sender.xml')/* } > stdin:55: query failed, Error: > XML Indexer: Fatal Parse error in document at line, 2, char 43. > Parser message: An exception occurred! > Type:RuntimeException, Message:Could not open DTD file 'Sender.dtd' > > Changing the URI to file:///home/milu/xpg/xml/Sender.xml doesn't help. > > The DTD is in the same directory as the document, and parsing the > document from other contexts works fine. > > So I think the database engine should be able to retrieve it using the > base URI of the document. Is this assumption correct? > > Michael Ludwig > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From clearlymichele at yahoo.com Sat Apr 11 12:59:23 2009 From: clearlymichele at yahoo.com (Michele Cleary) Date: Sat Apr 11 11:59:18 2009 Subject: [xquery-talk] XQuery voice xml dtd use Message-ID: <661911.19162.qm@web32005.mail.mud.yahoo.com> I'm trying to get the dtd into my voice xml xquery.? For some reason, it's giving me a syntax error.? Output looked great and syntax was fine before I added the declare option parts.? I ran this in oxygen XML Editor 10.1, build 2009022712 using the xquery debugger. My xquery document is genVInfo.xquery: declare namespace local = "http://lyle.smu.edu/~mcleary/a3"; (: use name to look up group :) declare function local:getGroup($theName as xs:string?) as xs:string? { ??? let $group := ??? for $user in doc("domain.xml")//user ??? where $user/name = $theName ??? return $user//group return $group }; let $phone := "5854674893" let $output := ??? for $dom in doc("domain.xml")/users/user, ???? $user in doc("users.xml")/users/user[@phone = $phone] ???? where $dom/name=$user/name ???? return ("Welcome to Group Finder", data($dom/name) , ". We see that you", ???? for $fan in $dom/name ???? return concat(" like the group: ", local:getGroup(data($fan)) ) ) return declare option saxon:output '"doctype-public=-//W3C//DTD VOICEXML 2.0//EN"'; declare option saxon:output '"doctype-system=http://www.w3.org/TR/voicexml21/vxml.dtd"';
? { ? ?? ?? ???? {$output} ? ?? ?? ?? } ? ?
My users.xml is: ?? ?????? Mary Lamb ?????? ?????????? Jack Johnson ?????? ?? ??? ??????? Little Muffit ??????? ?????????? Sarah Brightman ?????? ?? ??? ?????? Jack Jill ?????? ?????????? UB40 ?????? ?? My domain.xml is: ?????? Mary Lamb ?????? ?????????? JackJohnson ?????????? http://tinyurl.com/ajoc8r ?????????? http://www.mp3raid.com/search/mp3/jack_johnson.html ?????????? http://www.fiercepoet.com/index.php/weblog/2005/05/ ?????????? http://blogs.thenewstribune.com/ej/2008/03/03/jack_johnson_set_to_rock_the_gorge ?????? ?? ?? ?????? Little Muffit ?????? ?????????? SarahBrightman ?????????? http://tinyurl.com/cdy4cq ?????????? http://www.mp3raid.com/search/mp3/sarah_brightman.html ?????????? http://noolmusic.com/search_videos/sarah_brightman ?????????? http://artsblog.freedomblogging.com/2008/12/17/sarah-brightman-disses-her-high-f/5144/ ?????? ?? ?? ?????? Jack Jill ?????? ?????????? UB40 ?????????? http://tinyurl.com/bsxknz ?????????? http://www.mp3raid.com/search/mp3/ub40.html ?????????? https://www.freebase.com/view/en/ub40 ?????????? http://www.pop-music.com/article1277.html ?????? ?? Output looks like this: ??
????? ???????? Welcome to Group Finder Mary Lamb . We see that you? like the group: JackJohnson ????? ??
My syntax error when I added the declare option is: F [Saxon-B XQuery 9.1.0.5] XQuery syntax error in #...n declare option saxon:output#:???? Unexpected token "declare option" in path expression Any idea how to fix it?? I need my output to look like this at the top: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090411/db59dd7e/attachment.htm From davidc at nag.co.uk Sat Apr 11 22:20:24 2009 From: davidc at nag.co.uk (David Carlisle) Date: Sat Apr 11 13:20:30 2009 Subject: [xquery-talk] XQuery voice xml dtd use In-Reply-To: <661911.19162.qm@web32005.mail.mud.yahoo.com> (message from Michele Cleary on Sat, 11 Apr 2009 11:59:23 -0700 (PDT)) References: <661911.19162.qm@web32005.mail.mud.yahoo.com> Message-ID: <200904112020.n3BKKOx6012805@edinburgh.nag.co.uk> declarr option lines are xquery prolog declarations, Like all declare...; constucts they need to come first, before the xquery expression. So in this case, with your function declarations, before the let $phone := line that starts the xquery expression. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From lists at fgeorges.org Sat Apr 11 20:31:24 2009 From: lists at fgeorges.org (Florent Georges) Date: Sat Apr 11 15:33:51 2009 Subject: [xquery-talk] XQuery voice xml dtd use In-Reply-To: <661911.19162.qm@web32005.mail.mud.yahoo.com> Message-ID: <482936.82544.qm@web23003.mail.ird.yahoo.com> Michele Cleary wrote: Hi, > F [Saxon-B XQuery 9.1.0.5] XQuery syntax error in #...n > declare option saxon:output#: Unexpected token > "declare option" in path expression I think declare option must be in the prolog, just before or after your declare namespace. Regards, -- Florent Georges http://www.fgeorges.org/ From mlu at as-guides.com Wed Apr 15 11:48:44 2009 From: mlu at as-guides.com (Michael Ludwig) Date: Wed Apr 15 01:45:19 2009 Subject: [xquery-talk] doc() function failing to load DTD In-Reply-To: <84F30D7F-4EC0-4D90-9F5B-D49D9EDD2767@maine.rr.com> References: <49DE1B05.2090902@as-guides.com> <84F30D7F-4EC0-4D90-9F5B-D49D9EDD2767@maine.rr.com> Message-ID: <49E59F6C.4040701@as-guides.com> George Feinberg schrieb: > Michael, > > Your issue is somewhat product-specific. In this case you are using > Berkeley DB XML and it's dbxml shell program for testing. Hi George :-) Yes, exactly, dbxml shell for testing. > The problem is not the URI for the file but the file's reference to > the DTD. BDB XML uses Xerces-C for parsing/validation and > by default Xerces-C will look in the current directory for DTDs > referenced by a relative pathname (e.g. "Sender.dtd"). If you > change that to an absolute pathname or file: URI your query > will succeed. Yes, that works. > In BDB XML you have another option if you write it into your > program (vs using the dbxml shell). You can implement XmlResolver > and resolve entities such as DTDs yourself. That works fine, too. I took a look at the C++ sample program contained in the Berkeley DB XML distribution and implemented something similar to set a base URI for external entities, which I'm appending in case anyone is looking for it. Regards, Michael Ludwig public final class TestResolver extends XmlResolver { private String dir; public void setDirectory(String dir) { if (dir.endsWith("/")) this.dir = dir; else this.dir = dir + "/"; } public XmlInputStream resolveEntity( XmlTransaction txn, XmlManager mgr, String systemId, String publicId) throws XmlException { String path = dir + systemId; System.err.format("RESOLVER: %s -> %s%n", systemId, path); return mgr.createLocalFileInputStream(path); } } Usage: TestResolver resolver = new TestResolver(); resolver.setDirectory( "C:/MILU/dev"); xmlManager.registerResolver(resolver); From lists at fgeorges.org Wed Apr 15 23:34:37 2009 From: lists at fgeorges.org (Florent Georges) Date: Wed Apr 15 13:33:40 2009 Subject: [xquery-talk] [ANN] EXPath: collaboratively defining XPath extensions Message-ID: Hi, In the past few months, we could hear more and more the demand for a standardized set of extensions for XSLT and XQuery, as the recent activity around EXSLT 2.0 and EXQuery (within which I am involved) can tell. Those projects try to fulfill real-world needs, in the tradition of EXSLT, and that's a good thing. But as those projects were fixing their objectives, it became clear they overlap, as one of their goals is to provide more functionalities through the definition of extension functions. Why one would want to define twice an extension function to deal with HTTP or to handle ZIP files? Those facts, with the help of interesting discussions at XML Prague, leaded to the evidence that a similar project, working at the XPath level, would better achieve the goal of defining a set of standardized extension functions. In the same way the XSLT and XQuery working groups at the W3C joined their efforts to collaboratively define XPath 2.0, while host language-specifics were the responsibility of each WG. In addition, working at the XPath level provide the ability to implement them for other host languages, as XProc, as well for standalone XPath implementations (for instance in Java or .Net.) In this idea of defining a single set of extension functions, I am very proud to announce EXPath: http://www.expath.org/. The project is just born, but you can already find an HTTP module. If you are interested in participating in this project, if you have ideas, or if you just want to use its functions, please join the mailing list and let us know! Hope to see on the list, -- Florent Georges http://www.fgeorges.org/ From int19h at gmail.com Mon Apr 20 16:29:34 2009 From: int19h at gmail.com (Pavel Minaev) Date: Mon Apr 20 15:29:58 2009 Subject: [xquery-talk] Reserved namespaces, and QNames as extension keywords Message-ID: I have two questions regarding implementation conformance to the XQuery spec. 1) The spec requires every module and schema to be associated with a namespace, and seemingly doesn't restrict the value domain for such namespaces (except for restricting clashes between several modules/schemas imported within a single query). Can an XQuery implementation go further than that, and reserve specific namespaces for its own use, not allowing programmer to define his modules and schemas within that namespace at all? (but, e.g., providing some additional predefined types available from such namespaces without any "import schema" declarations). 2) Assuming the answer to #1 is true, is it legal for a conforming XQuery implementation to use QNames from such a reserved namespace as "keywords" (i.e. syntax elements for extension language constructs), without fear of clashing with future XQuery versions? I.e. something along the lines of: declare namespace ext = "..."; declare variable $f as ext:function(xs:integer, xs:integer => xs:integer) (* custom type keyword *) := ext:lambda($x as xs:integer, $y as xs:integer) as xs:integer { $x + $y } (* custom syntactic construct *) I am aware of pragmas and "declare option", but, obviously, they are much more limited - in example above, ext:lambda could possibly be a pragma, though that would complicate nesting; but I don't see any way to use extensibility mechanisms explicitly spelled out in XQuery spec for something like ext:function. If the existing spec explicitly disallows such things, then I would like to propose enabling them in future XQuery versions; maybe with a new special construct to declare such "extensibility" namespaces for extra clarity, e.g.: declare extension namespace ext = "..."; From gkholman at CraneSoftwrights.com Mon Apr 20 19:47:08 2009 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Mon Apr 20 15:45:23 2009 Subject: [xquery-talk] Reserved namespaces, and QNames as extension keywords In-Reply-To: References: Message-ID: <7.0.1.0.2.20090420183654.025f0c00@wheresmymailserver.com> At 2009-04-20 15:29 -0700, Pavel Minaev wrote: >I have two questions regarding implementation conformance to the XQuery spec. > >1) The spec requires every module and schema to be associated with a >namespace, and seemingly doesn't restrict the value domain for such >namespaces (except for restricting clashes between several >modules/schemas imported within a single query). Correct. A namespace is just a URI string and there are no constraints on the strings based on module importation. >Can an XQuery >implementation go further than that, and reserve specific namespaces >for its own use, not allowing programmer to define his modules and >schemas within that namespace at all? (but, e.g., providing some >additional predefined types available from such namespaces without any >"import schema" declarations). Not that I know of from my read of the specification. >2) Assuming the answer to #1 is true, is it legal for a conforming >XQuery implementation to use QNames from such a reserved namespace as >"keywords" (i.e. syntax elements for extension language constructs), The only expression extension allowed is the pragma and the pragma only has influence over its associated expression: (# pragma here #) { (:associated expression here:) } >without fear of clashing with future XQuery versions? It is not possible to define one's one keywords so there is no risk of name collision. >I.e. something along the lines of: > > declare namespace ext = "..."; > > declare variable $f > as ext:function(xs:integer, xs:integer => xs:integer) (* custom type >keyword *) > := ext:lambda($x as xs:integer, $y as xs:integer) as xs:integer { $x >+ $y } (* custom syntactic construct *) For future reference, the comment facility uses "(: comment :)" syntax. >I am aware of pragmas and "declare option", but, obviously, they are >much more limited - in example above, ext:lambda could possibly be a >pragma, though that would complicate nesting; but I don't see any way >to use extensibility mechanisms explicitly spelled out in XQuery spec >for something like ext:function. It is unclear to me what benefit or feature you are trying to get with the ability to declare keywords. How are keywords better than function calls? What problem are you trying to solve? >If the existing spec explicitly disallows such things, then I would >like to propose enabling them in future XQuery versions; maybe with a >new special construct to declare such "extensibility" namespaces for >extra clarity, e.g.: > > declare extension namespace ext = "..."; To address what use case that is not already addressed by the language? You've asked a lot of "is there?" questions but I don't see a lot of "my problem" statements to be addressed. I hope this helps. . . . . . . . . . . Ken -- XQuery/XSLT/XSL-FO hands-on training - Los Angeles, USA 2009-06-08 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal From mike at saxonica.com Tue Apr 21 00:54:19 2009 From: mike at saxonica.com (Michael Kay) Date: Mon Apr 20 15:52:13 2009 Subject: [xquery-talk] Reserved namespaces, and QNames as extension keywords In-Reply-To: References: Message-ID: It's normal practice with namespaces to rely on the fact that if you use a namespace based on a domain name that you own, then it's yours and other people can't walk all over it. However, making a namespace "magic" in ways other than the extensibility mechanisms defined in the spec is probably best avoided. If you're going to invent syntactic extensions then user queries aren't going to be interoperable across implementations at all, so qualifying such extensions with namespaces seems to have very little benefit, other than perhaps making a clash with future standardized language constructs less likely. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Pavel Minaev > Sent: 20 April 2009 23:30 > To: talk@x-query.com > Subject: [xquery-talk] Reserved namespaces, and QNames as > extension keywords > > I have two questions regarding implementation conformance to > the XQuery spec. > > 1) The spec requires every module and schema to be associated > with a namespace, and seemingly doesn't restrict the value > domain for such namespaces (except for restricting clashes > between several modules/schemas imported within a single > query). Can an XQuery implementation go further than that, > and reserve specific namespaces for its own use, not allowing > programmer to define his modules and schemas within that > namespace at all? (but, e.g., providing some additional > predefined types available from such namespaces without any > "import schema" declarations). > > 2) Assuming the answer to #1 is true, is it legal for a > conforming XQuery implementation to use QNames from such a > reserved namespace as "keywords" (i.e. syntax elements for > extension language constructs), without fear of clashing with > future XQuery versions? I.e. something along the lines of: > > declare namespace ext = "..."; > > declare variable $f > as ext:function(xs:integer, xs:integer => xs:integer) (* > custom type keyword *) > := ext:lambda($x as xs:integer, $y as xs:integer) as xs:integer { $x > + $y } (* custom syntactic construct *) > > I am aware of pragmas and "declare option", but, obviously, > they are much more limited - in example above, ext:lambda > could possibly be a pragma, though that would complicate > nesting; but I don't see any way to use extensibility > mechanisms explicitly spelled out in XQuery spec for > something like ext:function. > > If the existing spec explicitly disallows such things, then I > would like to propose enabling them in future XQuery > versions; maybe with a new special construct to declare such > "extensibility" namespaces for extra clarity, e.g.: > > declare extension namespace ext = "..."; > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From int19h at gmail.com Mon Apr 20 17:08:44 2009 From: int19h at gmail.com (Pavel Minaev) Date: Mon Apr 20 16:04:11 2009 Subject: [xquery-talk] Reserved namespaces, and QNames as extension keywords In-Reply-To: <7.0.1.0.2.20090420183654.025f0c00@wheresmymailserver.com> References: <7.0.1.0.2.20090420183654.025f0c00@wheresmymailserver.com> Message-ID: On Mon, Apr 20, 2009 at 3:47 PM, G. Ken Holman wrote: >> 1) The spec requires every module and schema to be associated with a >> namespace, and seemingly doesn't restrict the value domain for such >> namespaces (except for restricting clashes between several >> modules/schemas imported within a single query). > > Correct. ?A namespace is just a URI string and there are no constraints on > the strings based on module importation. > >> Can an XQuery >> implementation go further than that, and reserve specific namespaces >> for its own use, not allowing programmer to define his modules and >> schemas within that namespace at all? (but, e.g., providing some >> additional predefined types available from such namespaces without any >> "import schema" declarations). > > Not that I know of from my read of the specification. I wonder if it makes at least some implementations not compliant in that respect, then - e.g. Saxon seems to reserve certain namespaces to map to Java/.NET types. >> 2) Assuming the answer to #1 is true, is it legal for a conforming >> XQuery implementation to use QNames from such a reserved namespace as >> "keywords" (i.e. syntax elements for extension language constructs), > > The only expression extension allowed is the pragma and the pragma only has > influence over its associated expression: > > ?(# pragma here #) { (:associated expression here:) } Technically, a pragma expression can well be {()} or even {error((), "Not supported")}, and the pragma itself can contain an XQuery expression (possibly extended in some way). >> I.e. something along the lines of: >> >> ?declare namespace ext = "..."; >> >> ?declare variable $f >> ?as ext:function(xs:integer, xs:integer => xs:integer) (* custom type >> keyword *) >> ?:= ext:lambda($x as xs:integer, $y as xs:integer) as xs:integer { $x >> + $y } (* custom syntactic construct *) > > For future reference, the comment facility uses "(: comment :)" syntax. Yes, sorry about that. I get it mixed up with ML all the time. >> I am aware of pragmas and "declare option", but, obviously, they are >> much more limited - in example above, ext:lambda could possibly be a >> pragma, though that would complicate nesting; but I don't see any way >> to use extensibility mechanisms explicitly spelled out in XQuery spec >> for something like ext:function. > > It is unclear to me what benefit or feature you are trying to get with the > ability to declare keywords. ?How are keywords better than function calls? > ?What problem are you trying to solve? The problem (well, one of the problems) I'm trying to solve is demonstrated in my example - first-class function literals. Defining values of that type is possible using eval-like functions which take a string, e.s.: ext:lambda("($x as xs:integer, $y as xs:integer) as xs:integer { $x + $y }") But this, in my opinion, is a very ugly solution, since it causes all types of problems with precompiling implementations, as well as IDEs. It's also more lax than it needs to be, because in this case, ext:lambda would have to be able to handle any valid string passed to it at run-time; ideally, I'd want it to be a construct that it entirely handled strictly at compile-time. As I've pointed out in my previous post, pragma is a viable alternative here, though it has problems with nesting (since one can't nest a pragma inside another pragma - the outer pragma will terminate at the first occurence of "#)"). But for e.g. first-class function types extension, I don't see any real options aside from introducing new syntax. >> If the existing spec explicitly disallows such things, then I would >> like to propose enabling them in future XQuery versions; maybe with a >> new special construct to declare such "extensibility" namespaces for >> extra clarity, e.g.: >> >> ?declare extension namespace ext = "..."; > > To address what use case that is not already addressed by the language? See above. Basically, it would allow for extensibility points outside expression context (which is covered by pragma) - in particular, for type references. Aside from function types and lambdas, I can think about a few other use cases. E.g.: (: Foreign type system integration :) declare function local:foo($obj as java:ref(java.lang.Object)) { ... } (: Parametric polymorphism extension :) ext:forall(a) declare function seq:every-second($x as ext:type-parameter(a)*) as ext:type-parameter(a)* { ... } I don't see why it's any more problematic than e.g. "declare option", which already introduces the possibility of queries using implementation-specific features with no fallback option (unlike pragmas). From mike at saxonica.com Tue Apr 21 09:08:32 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Apr 21 00:04:26 2009 Subject: [xquery-talk] Reserved namespaces, and QNames as extension keywords In-Reply-To: References: <7.0.1.0.2.20090420183654.025f0c00@wheresmymailserver.com> Message-ID: <97F5256A893844BCB718920F03076E54@Sealion> > > I wonder if it makes at least some implementations not > compliant in that respect, then - e.g. Saxon seems to reserve > certain namespaces to map to Java/.NET types. I've tried very hard in Saxon to do extensions in a way that preserves the maximum level of interoperability. The specification allows functions, types, etc to be added by the implementation to the static context, and Saxon uses this mechanism. In most cases Saxon uses namespaces based on its own registered domain name. An exception is made for URIs of the form java:com.acme.package.Class which represent Java classes; this form of URI evolved as a convention to allow interoperability between different Java-based XSLT processors. And it's not in fact reserved; you can define your own user-written functions in such a namespace and they will take precedence. > > >> 2) Assuming the answer to #1 is true, is it legal for a conforming > >> XQuery implementation to use QNames from such a reserved > namespace as > >> "keywords" (i.e. syntax elements for extension language > constructs), > > > > The only expression extension allowed is the pragma and the pragma > > only has influence over its associated expression: > > > > ?(# pragma here #) { (:associated expression here:) } > > ... > The problem (well, one of the problems) I'm trying to solve > is demonstrated in my example - first-class function > literals. Defining values of that type is possible using > eval-like functions which take a string, e.s.: > > ext:lambda("($x as xs:integer, $y as xs:integer) as > xs:integer { $x + $y }") > Many vendors are in fact adding syntactic extensions to XQuery. The specification itself is unclear on what the rules for this are; I asked for clarification in a bug report recently: http://www.w3.org/Bugs/Public/show_bug.cgi?id=6027 What emerged in discussion is that most XQuery vendors want the freedom to extend the language in arbitrary ways. Users appear to be tolerant of this, probably because expectations of interoperability in the database world are historically rather low. It's also true that in comparison with XSLT, the extension points for the language are not particularly good (this is an area where the use of an XML-based syntax gives XSLT a real advantage). My own advice would be to implement your extensions in whatever way you want, thinking about how to reduce the risk of conflict with future XQuery versions, but require users to take explicit action to activate these extensions so they know when they are departing from interoperable syntax. On the specific area of first-class function literals, I would suggest waiting until you see the next working draft of XQuery 1.1. Michael Kay http://www.saxonica.com/ From matthias.brantner at 28msec.com Wed Apr 22 06:22:24 2009 From: matthias.brantner at 28msec.com (Matthias Brantner) Date: Wed Apr 22 05:22:57 2009 Subject: [xquery-talk] ANN: Pre-release of XQDT 2.0 Message-ID: <635CD38E-B1A6-4877-B017-4BF050A34A9C@28msec.com> Dear all, the XQuery Development Tools for Eclipse 2.0 (XQDT) are a complete rewrite of XQDT 1.0 based on the DLTK Framework (Dynamic Languages Toolkit). With DLTK, XQDT will have improved syntax highlighting, error handling, and code completion. Furthermore, XQDT 2.0 is based on an ANTLR parser. Specifically, XQDT 2.0 has the following new features: - Editor: A number of new features such as bracket matching and code folding. - Error handling: Report multiple errors of an XQuery program (rather than reporting the first error only). - Code completion: Context-sensitive function templates. Code completion of library functions. - Support for Zorba: The XQDT 2.0 parser accepts all Zorba-specific (http://www.zorba-xquery.com/ ) constructs such as scripting, eval function, etc. - Support for Sausalito: XQDT 2.0 supports all functions of the Sausalito CoreSDK (http://www.28msec.com/) such as creating, testing, and deploying a project in the Amazon cloud. We are providing a pre-release of XQDT 2.0 with limited functionality. This pre-release only supports XQuery 1.0. Furthermore, this pre- release does not support debugging yet. We are making this early pre- release because we are interested in comments, feedback, and feature requests. Please, post bugs and feature requests on the XQDT bug- tracker on Sourceforge: http://www.sourceforge.org/projects/xqdt/. The full XQDT 2.0 release is scheduled for June 2009. The Eclipse update site is available at: http://www.xqdt.org/xqdt/ 2.0/. For more information read the installation instructions on the ?Installing XQDT 2.0? page at http://www.xqdt.org/. Best regards XQDT Team -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090422/a076cb54/attachment.htm From jonathan.robie at redhat.com Thu Apr 23 11:50:25 2009 From: jonathan.robie at redhat.com (Jonathan Robie) Date: Thu Apr 23 07:51:37 2009 Subject: [xquery-talk] XQuery, XPath, XSLT (Second Edition) - Proposed Edited Recommendations for review by 31 May Message-ID: <49F08031.1090100@redhat.com> The XML Query and XSL Working Groups have now released Proposed Edited Recommendations of the XQuery 1.0, XPath 2.0, and XSLT 2.0 specifications. These fix known bugs and problems, and are out for community review. Some of these changes affect conformance. If these documents pass public review, they will become W3C Recommendations. These documents were published 21 April 2009, and the review period ends 31 May 2009: XQuery 1.0 and XPath 2.0 Data Model (XDM) (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xpath-datamodel-20090421/ XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xpath-functions-20090421/ XML Path Language (XPath) 2.0 (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xpath20-20090421/ XQuery 1.0: An XML Query Language (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xquery-20090421/ XQuery 1.0 and XPath 2.0 Formal Semantics (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xquery-semantics-20090421/ XML Syntax for XQuery 1.0 (XQueryX) (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xqueryx-20090421 XSLT 2.0 and XQuery 1.0 Serialization (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xslt-xquery-serialization-20090421/ XSL Transformations (XSLT) Version 2.0 (Second Edition) Proposed Edited Recommendation http://www.w3.org/TR/2009/PER-xslt20-20090421/ From tracknerd2003 at yahoo.com Thu Apr 23 10:49:31 2009 From: tracknerd2003 at yahoo.com (Eric Robinson) Date: Thu Apr 23 09:50:33 2009 Subject: [xquery-talk] outer for Message-ID: <206427.62336.qm@web65408.mail.ac4.yahoo.com> I was wondering if someone can help me with a xquery issue I am having. ? What I am trying to do is create a web page that will allow a user to enter information about what they are looking for in a xml document and return to them the xml document if it matches their criteria. I thought I had it all working till I hit an issue with missing repeatable complex types. ? Example of xml and xquery that works. ? ? Data on the web ? Dan Suciu ?
??? Introduction ???
????? Traditional ????? ???
???
????? Examples ????? ???
?
?
??? Syntax ?
? for $book in /book for $section in $book/section for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples' and $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book ? Since the xml matches the where at
????? Examples ?????
it returns me the enitre document like I want. ? Example that breaks my xquery. ? Data on the web ? Dan Suciu ?
??? Introduction ???
?
??? Syntax ?
? for $book in /book for $section in $book/section for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples'?or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book ? This will always return nothing because there is no /book/section/figure in the xml. ? I believe once "outer for" is implemented I will be able to do ? for $book in /book for $section in $book/section outer for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples'?or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book ? ? Anyone have any ideas how I could get this to work? ? ? ? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090423/009917df/attachment.htm From davidc at nag.co.uk Thu Apr 23 19:09:10 2009 From: davidc at nag.co.uk (David Carlisle) Date: Thu Apr 23 10:10:12 2009 Subject: [xquery-talk] outer for In-Reply-To: <206427.62336.qm@web65408.mail.ac4.yahoo.com> (message from Eric Robinson on Thu, 23 Apr 2009 09:49:31 -0700 (PDT)) References: <206427.62336.qm@web65408.mail.ac4.yahoo.com> Message-ID: <200904231709.n3NH9Alx005736@edinburgh.nag.co.uk> Do you need a for at all, if I understand your query, isn't it just /book [author='Dan Suciu'] [section[title='Syntax' or figure[title='Examples' and image/@source='example.gif']]] David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From mike at saxonica.com Thu Apr 23 19:30:45 2009 From: mike at saxonica.com (Michael Kay) Date: Thu Apr 23 10:31:51 2009 Subject: [xquery-talk] outer for In-Reply-To: <206427.62336.qm@web65408.mail.ac4.yahoo.com> References: <206427.62336.qm@web65408.mail.ac4.yahoo.com> Message-ID: You're approaching this with a SQL mindset, and in my view that's not the right place to start - we're dealing here with hierarchies rather than tables. I think it's often best to forget FLWOR expressions for this kind of thing and go back to basic XPath, because XPath is more natural to the hierarchical structure of XML. Keep FLWOR expressions for when you need to do real joins using value-based relationships. I'm having a little trouble working out what your query is intended to mean. The predicate: (($figure/title='Examples' or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) has the form (A or B) or (A and C) which is equivalent to (A or B) But let's imagine that the second test on $figure/title was looking for 'Examples2', I would then write the query as book[author='Dan Suciu'][section/title='Syntax' or section/figure/title='Examples' or section/figure[title='Examples2' and image/@source='example.gif']] No need for XQuery here - XPath 1.0 is quite sufficient. Michael Kay http://www.saxonica.com/ _____ From: talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] On Behalf Of Eric Robinson Sent: 23 April 2009 17:50 To: talk@x-query.com Subject: [xquery-talk] outer for I was wondering if someone can help me with a xquery issue I am having. What I am trying to do is create a web page that will allow a user to enter information about what they are looking for in a xml document and return to them the xml document if it matches their criteria. I thought I had it all working till I hit an issue with missing repeatable complex types. Example of xml and xquery that works. Data on the web Dan Suciu
Introduction
Traditional
Examples
Syntax
for $book in /book for $section in $book/section for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples' and $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book Since the xml matches the where at
Examples
it returns me the enitre document like I want. Example that breaks my xquery. Data on the web Dan Suciu
Introduction
Syntax
for $book in /book for $section in $book/section for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples' or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book This will always return nothing because there is no /book/section/figure in the xml. I believe once "outer for" is implemented I will be able to do for $book in /book for $section in $book/section outer for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples' or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book Anyone have any ideas how I could get this to work? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090423/dfcbf7ab/attachment-0001.htm From tracknerd2003 at yahoo.com Thu Apr 23 12:11:05 2009 From: tracknerd2003 at yahoo.com (Eric Robinson) Date: Thu Apr 23 11:12:07 2009 Subject: [xquery-talk] outer for In-Reply-To: Message-ID: <989921.35164.qm@web65404.mail.ac4.yahoo.com> Thanks for replying. ? The solution worked for what I am trying to do. The predicate I gave you was just an example I was trying to come up with to make the where a little more complicated and cover all the conditions I was having issues with. --- On Thu, 4/23/09, Michael Kay wrote: From: Michael Kay Subject: RE: [xquery-talk] outer for To: tracknerd2003@yahoo.com, talk@x-query.com Date: Thursday, April 23, 2009, 1:30 PM You're approaching this with a SQL mindset, and in my view that's not the right place to start - we're dealing here with hierarchies rather than tables. ? I think it's often best to forget FLWOR expressions for this kind of thing and go back to basic XPath, because XPath is more?natural to the hierarchical structure of XML. Keep FLWOR expressions for when you need to do real joins using value-based relationships. ? I'm having a little trouble working out what your query is intended to mean. The predicate: ? (($figure/title='Examples'?or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) ? has the form ? (A or B) or (A and C) ? which is equivalent to ? (A or B) ? But let's imagine that the second test on $figure/title was looking for 'Examples2', I would then write the query as ? ? book[author='Dan Suciu'][section/title='Syntax' or section/figure/title='Examples' or section/figure[title='Examples2' and image/@source='example.gif']] ? No need for XQuery here - XPath 1.0 is quite sufficient. ? Michael Kay http://www.saxonica.com/ From: talk-bounces@x-query.com [mailto:talk-bounces@x-query.com] On Behalf Of Eric Robinson Sent: 23 April 2009 17:50 To: talk@x-query.com Subject: [xquery-talk] outer for I was wondering if someone can help me with a xquery issue I am having. ? What I am trying to do is create a web page that will allow a user to enter information about what they are looking for in a xml document and return to them the xml document if it matches their criteria. I thought I had it all working till I hit an issue with missing repeatable complex types. ? Example of xml and xquery that works. ? ? Data on the web ? Dan Suciu ?
??? Introduction ???
????? Traditional ????? ???
???
????? Examples ????? ???
?
?
??? Syntax ?
? for $book in /book for $section in $book/section for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples' and $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book ? Since the xml matches the where at
????? Examples ?????
it returns me the enitre document like I want. ? Example that breaks my xquery. ? Data on the web ? Dan Suciu ?
??? Introduction ???
?
??? Syntax ?
? for $book in /book for $section in $book/section for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples'?or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book ? This will always return nothing because there is no /book/section/figure in the xml. ? I believe once "outer for" is implemented I will be able to do ? for $book in /book for $section in $book/section outer for $figure in $section/figure where ($book/author='Dan Suciu' and (($figure/title='Examples'?or $section/title='Syntax) or ($figure/title='Examples' and $figure/image/@source='example.gif'))) return $book ? ? Anyone have any ideas how I could get this to work? ? ? ? ? _______________________________________________ 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/20090423/954f2818/attachment.htm From tracknerd2003 at yahoo.com Thu Apr 23 12:12:33 2009 From: tracknerd2003 at yahoo.com (Eric Robinson) Date: Thu Apr 23 11:13:31 2009 Subject: [xquery-talk] outer for In-Reply-To: <200904231709.n3NH9Alx005736@edinburgh.nag.co.uk> Message-ID: <973925.22933.qm@web65401.mail.ac4.yahoo.com> Thanks for replying. That works for what I am doing. --- On Thu, 4/23/09, David Carlisle wrote: From: David Carlisle Subject: Re: [xquery-talk] outer for To: tracknerd2003@yahoo.com Cc: talk@x-query.com Date: Thursday, April 23, 2009, 1:09 PM Do you need a for at all, if I understand your query, isn't it just /book [author='Dan Suciu'] [section[title='Syntax' or figure[title='Examples' and image/@source='example.gif']]] David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ _______________________________________________ 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/20090423/45007e99/attachment.htm From matthias.brantner at 28msec.com Thu Apr 23 12:28:59 2009 From: matthias.brantner at 28msec.com (Matthias Brantner) Date: Thu Apr 23 11:30:01 2009 Subject: [xquery-talk] outer for In-Reply-To: <973925.22933.qm@web65401.mail.ac4.yahoo.com> References: <973925.22933.qm@web65401.mail.ac4.yahoo.com> Message-ID: <66E558FF-D4F3-4020-B3CB-1CAEBF4B9961@28msec.com> Just as a side note in the case you do not know that already. The latest XQuery 1.1 working draft (see http://www.w3.org/TR/xquery-11/) contains the concept of an outer for. In fact, your outer for query in your first mail was already correct with respect to XQuery 1.1 (except for a missing quote). The Zorba XQuery processor already implements most of XQuery 1.1. You can give your outer for query a try at http://try.zorba-xquery.com/. Matthias On Apr 23, 2009, at 11:12 AM, Eric Robinson wrote: > Thanks for replying. That works for what I am doing. > > --- On Thu, 4/23/09, David Carlisle wrote: > From: David Carlisle > Subject: Re: [xquery-talk] outer for > To: tracknerd2003@yahoo.com > Cc: talk@x-query.com > Date: Thursday, April 23, 2009, 1:09 PM > > Do you need a for at all, if I understand your query, isn't it just > > > /book > [author='Dan Suciu'] > [section[title='Syntax' or figure[title='Examples' and > image/@source='example.gif']]] > > > David > > ________________________________________________________________________ > The Numerical Algorithms Group Ltd is a company registered in England > and Wales with company number 1249803. The registered office is: > Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been scanned for all viruses by Star. The service is > powered by MessageLabs. > ________________________________________________________________________ > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > 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/20090423/c54a85ac/attachment.htm From tracknerd2003 at yahoo.com Thu Apr 23 17:12:00 2009 From: tracknerd2003 at yahoo.com (Eric Robinson) Date: Thu Apr 23 16:12:01 2009 Subject: [xquery-talk] outer for In-Reply-To: <66E558FF-D4F3-4020-B3CB-1CAEBF4B9961@28msec.com> Message-ID: <860502.86918.qm@web65409.mail.ac4.yahoo.com> Thanks for the response. I will have to check Zorba out. --- On Thu, 4/23/09, Matthias Brantner wrote: From: Matthias Brantner Subject: Re: [xquery-talk] outer for To: tracknerd2003@yahoo.com Cc: talk@x-query.com, "David Carlisle" Date: Thursday, April 23, 2009, 2:28 PM Just as a side note in the case you do not know that already. The latest XQuery 1.1 working draft (see?http://www.w3.org/TR/xquery-11/) contains the concept of an outer for. In fact, your outer for query in your first mail was already correct with respect to XQuery 1.1 (except for a missing quote). The Zorba XQuery processor already implements most of XQuery 1.1. You can give your outer for query a try at http://try.zorba-xquery.com/. Matthias On Apr 23, 2009, at 11:12 AM, Eric Robinson wrote: Thanks for replying. That works for what I am doing. --- On Thu, 4/23/09, David Carlisle wrote: From: David Carlisle Subject: Re: [xquery-talk] outer for To: tracknerd2003@yahoo.com Cc: talk@x-query.com Date: Thursday, April 23, 2009, 1:09 PM Do you need a for at all, if I understand your query, isn't it just /book [author='Dan Suciu'] [section[title='Syntax' or figure[title='Examples' and image/@source='example.gif']]] David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ _______________________________________________ talk@x-query.com http://x-query.com/mailman/listinfo/talk _______________________________________________ talk@x-query.com http://x-query.com/mailman/listinfo/talk _______________________________________________ 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/20090423/51a94867/attachment.htm From D.McBeath at elsevier.com Tue Apr 28 13:34:46 2009 From: D.McBeath at elsevier.com (McBeath, Darin W (ELS-STL)) Date: Tue Apr 28 10:23:23 2009 Subject: [xquery-talk] SPARQL to XQuery transformation Message-ID: I'm curious if anyone has investigated or developed a transformation which takes a query expressed in SPARQL syntax to one roughly expressed in an equivalent XQuery syntax. I realize that there will likely not always be a direct 1 to 1 mapping, will be dependencies on the underlying XML document structure, and that some of the queries could become quite complex. Thanks. Darin. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090428/a44452db/attachment.htm From vyacheslav.sedov at gmail.com Wed Apr 29 01:34:23 2009 From: vyacheslav.sedov at gmail.com (Vyacheslav Sedov) Date: Tue Apr 28 13:22:00 2009 Subject: [xquery-talk] SPARQL to XQuery transformation In-Reply-To: References: Message-ID: <7ab7cbac0904281334v67fe8a46j7228e52755a3a356@mail.gmail.com> SPARQL is not XML - i can bet that no one people did this convertor to my opinion the best way is to declare some XML schema that contain ("query logic") and transform from this XML to SPARQL and/or XQuery (maybe even MySQL, Google bigtable and so on) with best wishes, Slav On Tue, Apr 28, 2009 at 9:34 PM, McBeath, Darin W (ELS-STL) wrote: > I?m curious if anyone has investigated or developed a transformation which > takes a query expressed in SPARQL syntax to one roughly expressed in an > equivalent XQuery syntax.? I realize that there will likely not always be a > direct 1 to 1 mapping, will be dependencies on the underlying XML document > structure, ?and that some of the queries could become quite complex. > > > > Thanks. > > > > Darin. > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From D.McBeath at elsevier.com Tue Apr 28 17:48:16 2009 From: D.McBeath at elsevier.com (McBeath, Darin W (ELS-STL)) Date: Tue Apr 28 14:37:06 2009 Subject: [xquery-talk] SPARQL to XQuery transformation References: <7ab7cbac0904281334v67fe8a46j7228e52755a3a356@mail.gmail.com> Message-ID: True, but the serialized RDF (which SPARQL can query) could be stored as XML. -----Original Message----- From: Vyacheslav Sedov [mailto:vyacheslav.sedov@gmail.com] Sent: Tue 4/28/2009 3:34 PM To: McBeath, Darin W (ELS-STL) Cc: talk@x-query.com Subject: Re: [xquery-talk] SPARQL to XQuery transformation SPARQL is not XML - i can bet that no one people did this convertor to my opinion the best way is to declare some XML schema that contain ("query logic") and transform from this XML to SPARQL and/or XQuery (maybe even MySQL, Google bigtable and so on) with best wishes, Slav On Tue, Apr 28, 2009 at 9:34 PM, McBeath, Darin W (ELS-STL) wrote: > I'm curious if anyone has investigated or developed a transformation which > takes a query expressed in SPARQL syntax to one roughly expressed in an > equivalent XQuery syntax.? I realize that there will likely not always be a > direct 1 to 1 mapping, will be dependencies on the underlying XML document > structure, ?and that some of the queries could become quite complex. > > > > Thanks. > > > > Darin. > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From dlee at calldei.com Tue Apr 28 19:03:21 2009 From: dlee at calldei.com (David A. Lee) Date: Tue Apr 28 14:51:13 2009 Subject: [xquery-talk] SPARQL to XQuery transformation In-Reply-To: References: <7ab7cbac0904281334v67fe8a46j7228e52755a3a356@mail.gmail.com> Message-ID: <49F77D29.60706@calldei.com> The issue, IMHO, is that SPARQL is a lot more then an XML document query language. Its an inference query language.. thats a lot more then XQuery can do. It might be *possible* to do in XQuery but its not a simple "translation" of one query language to another, it would take writing an inference engine in xquery. quite a project. McBeath, Darin W (ELS-STL) wrote: > True, but the serialized RDF (which SPARQL can query) could be stored as XML. > > > -----Original Message----- > From: Vyacheslav Sedov [mailto:vyacheslav.sedov@gmail.com] > Sent: Tue 4/28/2009 3:34 PM > To: McBeath, Darin W (ELS-STL) > Cc: talk@x-query.com > Subject: Re: [xquery-talk] SPARQL to XQuery transformation > > SPARQL is not XML - i can bet that no one people did this convertor > > to my opinion the best way is to declare some XML schema that contain > ("query logic") and transform from this XML to SPARQL and/or XQuery > (maybe even MySQL, Google bigtable and so on) > > with best wishes, > Slav > > On Tue, Apr 28, 2009 at 9:34 PM, McBeath, Darin W (ELS-STL) > wrote: > >> I'm curious if anyone has investigated or developed a transformation which >> takes a query expressed in SPARQL syntax to one roughly expressed in an >> equivalent XQuery syntax. I realize that there will likely not always be a >> direct 1 to 1 mapping, will be dependencies on the underlying XML document >> structure, and that some of the queries could become quite complex. >> >> >> >> Thanks. >> >> >> >> Darin. >> >> _______________________________________________ >> talk@x-query.com >> http://x-query.com/mailman/listinfo/talk >> >> > > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- ----------------------------------------------------------- David A. Lee dlee@calldei.com http://www.calldei.com From mike at saxonica.com Wed Apr 29 00:28:09 2009 From: mike at saxonica.com (Michael Kay) Date: Tue Apr 28 15:15:51 2009 Subject: [xquery-talk] SPARQL to XQuery transformation In-Reply-To: <49F77D29.60706@calldei.com> References: <7ab7cbac0904281334v67fe8a46j7228e52755a3a356@mail.gmail.com> <49F77D29.60706@calldei.com> Message-ID: <9DD2F7971B654583A07553A4E3C3348D@Sealion> > It might be *possible* to do in XQuery but its not a simple > "translation" of one query language to another, it would take > writing an inference engine in xquery. quite a project. If you can write an interpreter for a query language then you can write a compiler for it. And compiling into XQuery is probably easier than compiling into machine code. So as far as I can see, it doesn't look intrinsically impossible at all. Michael Kay http://www.saxonica.com/ From dlee at calldei.com Tue Apr 28 21:32:49 2009 From: dlee at calldei.com (David A. Lee) Date: Tue Apr 28 17:20:46 2009 Subject: [xquery-talk] SPARQL to XQuery transformation In-Reply-To: <9DD2F7971B654583A07553A4E3C3348D@Sealion> References: <7ab7cbac0904281334v67fe8a46j7228e52755a3a356@mail.gmail.com> <49F77D29.60706@calldei.com> <9DD2F7971B654583A07553A4E3C3348D@Sealion> Message-ID: <49F7A031.2030704@calldei.com> I don't believe its impossible either, but I was thinking, as a purely functional language (if that makes a difference?) Is there any set of computations that xquery couldn't theoretically execute, that say a procedural language could ? Michael Kay wrote: >> It might be *possible* to do in XQuery but its not a simple >> "translation" of one query language to another, it would take >> writing an inference engine in xquery. quite a project. >> > > If you can write an interpreter for a query language then you can write a > compiler for it. And compiling into XQuery is probably easier than compiling > into machine code. So as far as I can see, it doesn't look intrinsically > impossible at all. > > Michael Kay > http://www.saxonica.com/ > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- ----------------------------------------------------------- David A. Lee dlee@calldei.com http://www.calldei.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090428/2849381a/attachment.htm From rob.gonzalez at gmail.com Wed Apr 29 04:07:08 2009 From: rob.gonzalez at gmail.com (Rob Gonzalez) Date: Tue Apr 28 23:54:47 2009 Subject: [xquery-talk] SPARQL to XQuery transformation In-Reply-To: <49F7A031.2030704@calldei.com> References: <7ab7cbac0904281334v67fe8a46j7228e52755a3a356@mail.gmail.com> <49F77D29.60706@calldei.com> <9DD2F7971B654583A07553A4E3C3348D@Sealion> <49F7A031.2030704@calldei.com> Message-ID: It's Turing-complete, so no, there is no inherent disadvantage to being purely functional, but it does have the advantage that computation over large amounts of data can be more easily parallelized, which is a huge advantage for XQuery in database systems. To your other point: inferencing isn't done as part of SPARQL syntactically; that's part of the underlying data model and query resolution. I see no obvious reason, though maybe one exists, why inferencing can't be done on an XML infoset (which is a directed graph) in the same way that it's done on RDF data (which is a directed graph). I think it would be interesting to try to use OWL to describe XML (OWL isn't specifically about RDF; it's just about things) to prove this out (indeed, the fact that RDF can be serialized as XML makes me think this wouldn't even be that challenging an exercise). best, -Rob On Tue, Apr 28, 2009 at 8:32 PM, David A. Lee wrote: > I don't believe its impossible either, but I was thinking, as a purely > functional language (if that makes a difference?) > Is there any set of computations that xquery couldn't theoretically execute, > that say a procedural language could ? > > > Michael Kay wrote: > > It might be *possible* to do in XQuery but its not a simple > "translation" of one query language to another, it would take > writing an inference engine in xquery. quite a project. > > > If you can write an interpreter for a query language then you can write a > compiler for it. And compiling into XQuery is probably easier than compiling > into machine code. So as far as I can see, it doesn't look intrinsically > impossible at all. > > Michael Kay > http://www.saxonica.com/ > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > > > -- > ----------------------------------------------------------- > David A. Lee > dlee@calldei.com > http://www.calldei.com > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From mike at saxonica.com Wed Apr 29 09:28:55 2009 From: mike at saxonica.com (Michael Kay) Date: Wed Apr 29 00:16:38 2009 Subject: [xquery-talk] SPARQL to XQuery transformation In-Reply-To: <49F7A031.2030704@calldei.com> References: <7ab7cbac0904281334v67fe8a46j7228e52755a3a356@mail.gmail.com> <49F77D29.60706@calldei.com> <9DD2F7971B654583A07553A4E3C3348D@Sealion> <49F7A031.2030704@calldei.com> Message-ID: <2DD653D7832E46B4B1E833B01997D6E7@Sealion> XQuery is Turing-complete, so there shouldn't be any theoretical problems. It could be that there are issues to do with data model coverage - for example XQuery 1.0 doesn't give access to unparsed entities, and doesn't provide any way to create namespaces whose names aren't known statically. But I think those are unlikely to be stopper issues. Michael Kay http://www.saxonica.com/ _____ From: David A. Lee [mailto:dlee@calldei.com] Sent: 29 April 2009 01:33 To: Michael Kay Cc: 'McBeath, Darin W (ELS-STL)'; talk@x-query.com; 'Vyacheslav Sedov' Subject: Re: [xquery-talk] SPARQL to XQuery transformation I don't believe its impossible either, but I was thinking, as a purely functional language (if that makes a difference?) Is there any set of computations that xquery couldn't theoretically execute, that say a procedural language could ? Michael Kay wrote: It might be *possible* to do in XQuery but its not a simple "translation" of one query language to another, it would take writing an inference engine in xquery. quite a project. If you can write an interpreter for a query language then you can write a compiler for it. And compiling into XQuery is probably easier than compiling into machine code. So as far as I can see, it doesn't look intrinsically impossible at all. Michael Kay http://www.saxonica.com/ _______________________________________________ talk@x-query.com http://x-query.com/mailman/listinfo/talk -- ----------------------------------------------------------- David A. Lee dlee@calldei.com http://www.calldei.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090429/d8079846/attachment.htm From michalmas at gmail.com Wed Apr 29 18:42:17 2009 From: michalmas at gmail.com (Michalmas) Date: Wed Apr 29 08:39:43 2009 Subject: [xquery-talk] [XQuery] limitations Message-ID: <701515240904290842w6616946fy834a3ce7e5f68c87@mail.gmail.com> Hi gents, I was wondering what are the limitations of XQuery? For instance, there are some limitations of regular exp (you can't parse what is not defined by a regular language).?Since XQuery uses XPath which uses reg exp - does it bring any limitations to XQuery search engine? I tried to google some examples, but mostly someone was able to prepare interesting query. I mean here typical XQuery and reg exp (there are some extensions to reg exp that diminish such limitations somehow, but here i am interested in pure definitions) Thanks, Michal From alavinio at gmail.com Wed Apr 29 12:52:59 2009 From: alavinio at gmail.com (alavinio@gmail.com) Date: Wed Apr 29 08:50:35 2009 Subject: [xquery-talk] [XQuery] limitations In-Reply-To: <701515240904290842w6616946fy834a3ce7e5f68c87@mail.gmail.com> References: <701515240904290842w6616946fy834a3ce7e5f68c87@mail.gmail.com> Message-ID: XQuery uses XPath which uses regeps in the same way C# or Java or Python use regexps. Regexps don't define XPath; they are just one tiny feature of XPaths, which are one part of XQuery. XQuery is a Turing-complete language. On Wed, Apr 29, 2009 at 11:42 AM, Michalmas wrote: > I was wondering what are the limitations of XQuery? For instance, > there are some limitations of regular exp (you can't parse what is not > defined by a regular language). Since XQuery uses XPath which uses reg > exp - does it bring any limitations to XQuery search engine? > > I tried to google some examples, but mostly someone was able to > prepare interesting query. > > I mean here typical XQuery and reg exp (there are some extensions to > reg exp that diminish such limitations somehow, but here i am > interested in pure definitions) > -- Tony Lavinio DataDirect Technologies alavinio@datadirect.com High-performance XML Processor: DataDirect XQuery http://www.xquery.com/ EDI/Flat File<->XML Converters (Java|.Net) http://www.xmlconverters.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://x-query.com/pipermail/talk/attachments/20090429/8dbc79d1/attachment.htm From james.fuller.2007 at gmail.com Wed Apr 29 19:05:53 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Wed Apr 29 09:02:57 2009 Subject: [xquery-talk] [XQuery] limitations In-Reply-To: <701515240904290842w6616946fy834a3ce7e5f68c87@mail.gmail.com> References: <701515240904290842w6616946fy834a3ce7e5f68c87@mail.gmail.com> Message-ID: check out www.exquery.org which attempts to address some of the limitations of XQuery http://www.exquery.org/standards/use-cases.xql lists out a few use cases (badly formatted) where XQuery has deficiencies. hth, Jim Fuller On Wed, Apr 29, 2009 at 5:42 PM, Michalmas wrote: > Hi gents, > > I was wondering what are the limitations of XQuery? For instance, > there are some limitations of regular exp (you can't parse what is not > defined by a regular language).?Since XQuery uses XPath which uses reg > exp - does it bring any limitations to XQuery search engine? > > I tried to google some examples, but mostly someone was able to > prepare interesting query. > > I mean here typical XQuery and reg exp (there are some extensions to > reg exp that diminish such limitations somehow, but here i am > interested in pure definitions) > > Thanks, > Michal > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > From mike at saxonica.com Wed Apr 29 18:06:45 2009 From: mike at saxonica.com (Michael Kay) Date: Wed Apr 29 09:04:01 2009 Subject: [xquery-talk] [XQuery] limitations In-Reply-To: <701515240904290842w6616946fy834a3ce7e5f68c87@mail.gmail.com> References: <701515240904290842w6616946fy834a3ce7e5f68c87@mail.gmail.com> Message-ID: <600A867ACC894244AE5ACFE90910FE8D@Sealion> XQuery is a Turing complete functional language, so its computational power is the same as that of all modern programming languages. If there are limitations, they lie in the data model, not in the expressive power of the language. For example, if your source documents have unparsed entities, XQuery is unable to see them. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: talk-bounces@x-query.com > [mailto:talk-bounces@x-query.com] On Behalf Of Michalmas > Sent: 29 April 2009 16:42 > To: talk@x-query.com > Subject: [xquery-talk] [XQuery] limitations > > Hi gents, > > I was wondering what are the limitations of XQuery? For > instance, there are some limitations of regular exp (you > can't parse what is not defined by a regular language).?Since > XQuery uses XPath which uses reg exp - does it bring any > limitations to XQuery search engine? > > I tried to google some examples, but mostly someone was able > to prepare interesting query. > > I mean here typical XQuery and reg exp (there are some > extensions to reg exp that diminish such limitations somehow, > but here i am interested in pure definitions) > > Thanks, > Michal > > _______________________________________________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk From jim.melton at acm.org Thu Apr 30 11:46:49 2009 From: jim.melton at acm.org (Jim Melton) Date: Thu Apr 30 10:21:01 2009 Subject: [xquery-talk] Re: talk Digest, Vol 72, Issue 12 In-Reply-To: <200904291540.n3TFeDPC001581@jhunter.x-query.com> References: <200904291540.n3TFeDPC001581@jhunter.x-query.com> Message-ID: <7.0.1.0.2.20090430103833.0cfc7560@xmission.com> On Tue, Apr 28, 2009 at 9:34 PM, McBeath, Darin W (ELS-STL) wrote: > > I'm curious if anyone has investigated or developed a transformation which > > takes a query expressed in SPARQL syntax to one roughly expressed in an > > equivalent XQuery syntax. I realize that there will likely not always be a > > direct 1 to 1 mapping, will be dependencies on the underlying XML document > > structure, and that some of the queries could become quite complex. I have not actually done the work to transform SPARQL into XQuery, but I have done considerable work (with considerable help!) on transforming SPARQL into SQL and have demonstrated (if not actually *proved*) that SPARQL and SQL are isomorphic. By that, I mean that, given a suitable SQL tabular representation of RDF (such as, but necessarily, a single table of three columns), it is possible to rewrite a SPARQL query into an SQL query on that representation of the RDF that produces the same result that the SPARQL query would have produced when run on a "native" RDF store. My company has also done very considerable work on transforming XQuery into SQL and have (for all practical purposes, although not mathematically) proven that XQuery and SQL are also isomorphic, given some suitable tabular representation of XML data. I assert with some confidence that if XQuery and SQL are isomorphic, and SQL and SPARQL are isomorphic, then XQuery and SPARQL are also isomorphic. I should point out that the SQL generated by the transformation process I and my colleagues devised was exceedingly ugly, complex, and visually inefficient; however, any reasonably competent SQL optimizer would be able to optimize away most, if not all, of the inefficiencies, provided the table(s) was(were) provided with suitable indexes. I would expect something similar from any transformation from SPARQL to XQuery. Hope this helps, Jim ======================================================================== Jim Melton --- Editor of ISO/IEC 9075-* (SQL) Phone: +1.801.942.0144 Chair, W3C XML Query WG; XQX (etc.) editor Fax : +1.801.942.3345 Oracle Corporation Oracle Email: jim dot melton at oracle dot com 1930 Viscounti Drive Standards email: jim dot melton at acm dot org Sandy, UT 84093-1063 USA Personal email: jim at melton dot name ======================================================================== = Facts are facts. But any opinions expressed are the opinions = = only of myself and may or may not reflect the opinions of anybody = = else with whom I may or may not have discussed the issues at hand. = ======================================================================== From james.fuller.2007 at gmail.com Thu Apr 30 23:12:52 2009 From: james.fuller.2007 at gmail.com (James Fuller) Date: Thu Apr 30 13:03:34 2009 Subject: [xquery-talk] [ANN] xprocxq v0.6.74 BETA an XProc processor written in XQuery Message-ID: Hello All, Just released xprocxq, which is an experimental bootstrap implementation of W3C XProc Draft Specification, written in xquery of all things. xprocxq project information and download http://code.google.com/p/xprocxq/ xprocxq runs within eXist XML Database but the original prototype was developed using SAXON-SA. I am planning to support more XQuery processors in the future but will focus on making xprocxq as compliant as possible for eXist XML Database. Future releases of xprocxq will be built and installed as part of eXist XML Database own build process.For BETA releases you will have to build xprocxq or download release zip and install manually into eXist. cheers, Jim Fuller