BaseX 7.6, XQJ API 1.2.3 and XQuery 3.0 features - syntax error for simple map operator

Wednesday, 20 February 2013 · 2 messages · last reply 22 Feb 2013
MA
Markus Ackermann20 Feb 2013 20:59 #
Hello BaseX-community, first of all, I really have to say that I really enjoy using BaseX and that I am really impressed by its active development and its ongoing improvement. I am still a little unsure about the Query 3.0 support via the BaseX XQJ driver from net.xqj, though. According to the Changelog of the website ([1]), XQuery 3.0 via XQJ is now supported: BaseX 7.3, 18.06.2012 [...] - Charles Foster's latest XQJ Driver supports XQuery 3.0 and the Update and Full Text extensions: http://xqj.net/basex/ The README file of Charles Foster's driver also states that XQuery 3.0 is supported since driver version 1.1.0: Version 1.1.0: * Supports XQuery 3.0 + XQuery Update Facility + XQuery Full Text extensions. * Various bug fixes. However, take this minimal example using the simple map operator (query A):
BaseXXQDataSource dataSource = new BaseXXQDataSource();
        dataSource.setServerName("localhost");
        dataSource.setPort(1984);
XQConnection con = dataSource.getConnection("dict_wsa", "lidell"); con.createExpression().executeQuery( "(1 to 3) ! (. * 2))"); //query A
        con.createExpression().executeQuery( "let $m := map { 'one' := 1, 'two' := 2 }" +
                                             "return ($m('one')"); //query B
Executing it yield a syntax exception: Exception in thread "main" javax.xml.xquery.XQException: XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. Root Cause: net.xqj.basex.bin.bn: Lexical error at line 1, column 11. Encountered: " " (32), after : "!" at XQ3Test.main(XQ3Test.java:21) at XQ3Test.main(XQ3Test.java:21) For query B I also receive a syntax exception: Exception in thread "main" javax.xml.xquery.XQException: XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. Root Cause: net.xqj.basex.bin.bj: Encountered " "{" "{ "" at line 1, column 15. Was expecting one of: "=" ... "order" ... "," ... Is there another option I have to set to circumvent the 'static validation' or did I overlook anything else? Regards and thanks in advance for any information or advice, Markus Ackermann PS: Information on the execution environment: JVM: 1.7.0_13 (Oracle Corporation 23.7-b01) OS: Linux 3.0.0-30-generic amd64 (Ubuntu 11.10) BaseX 7.6
CG
Christian Grün22 Feb 2013 11:42 #
Dear Markus, please note that maps are not part of the official recommendation yet [1]. They have been proposed by Michael Kay (the author of Saxon) some time ago, and a variant of it will probably be included in XQuery 3.1. However, we could think about adding BaseX-specific parsing rules to XQJ; this would be something Charles has to decide; just recently on this list, Andy has summarized the additional features of our XQuery parser [2]. All the best, Christian [1] http://docs.basex.org/wiki/Map_Module [2] http://www.mail-archive.com/basex-talk at mailman.uni-konstanz.de/msg02139.html
Quoted text · Markus Ackermann · 76 lines
On Wed, Feb 20, 2013 at 8:59 PM, Markus Ackermann <mam05ehm at studserv.uni-leipzig.de> wrote: > > Hello BaseX-community, > > first of all, I really have to say that I really enjoy using BaseX and that I am really impressed > by its active development and its ongoing improvement. > > I am still a little unsure about the Query 3.0 support via the BaseX XQJ driver from net.xqj, though. > According to the Changelog of the website ([1]), XQuery 3.0 via XQJ is now supported: > > > BaseX 7.3, 18.06.2012 > [...] > - Charles Foster's latest XQJ Driver supports XQuery 3.0 and the > Update and Full Text extensions: http://xqj.net/basex/ > > The README file of Charles Foster's driver also states that XQuery 3.0 is supported since driver version 1.1.0: > > Version 1.1.0: > * Supports XQuery 3.0 + XQuery Update Facility + XQuery Full Text extensions. > * Various bug fixes. > > However, take this minimal example using the simple map operator (query A): > > BaseXXQDataSource dataSource = new BaseXXQDataSource(); > dataSource.setServerName("localhost"); > dataSource.setPort(1984); > > XQConnection con = dataSource.getConnection("dict_wsa", "lidell"); > > con.createExpression().executeQuery( "(1 to 3) ! (. * 2))"); //query A > > con.createExpression().executeQuery( "let $m := map { 'one' := 1, 'two' := 2 }" + > "return ($m('one')"); //query B > > > Executing it yield a syntax exception: > > Exception in thread "main" javax.xml.xquery.XQException: > XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. > Root Cause: > net.xqj.basex.bin.bn: Lexical error at line 1, column 11. Encountered: " " (32), after : "!" > at XQ3Test.main(XQ3Test.java:21) > at XQ3Test.main(XQ3Test.java:21) > > > For query B I also receive a syntax exception: > > Exception in thread "main" javax.xml.xquery.XQException: > XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. > Root Cause: > net.xqj.basex.bin.bj: Encountered " "{" "{ "" at line 1, column 15. > Was expecting one of: > "=" ... > "order" ... > "," ... > > > Is there another option I have to set to circumvent the 'static validation' or did I overlook anything else? > > > > Regards and thanks in advance for any information or advice, > > Markus Ackermann > > > PS: Information on the execution environment: > JVM: 1.7.0_13 (Oracle Corporation 23.7-b01) > OS: Linux 3.0.0-30-generic amd64 (Ubuntu 11.10) > BaseX 7.6 > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

⚡Generated with XQuery