From janstapel00 at hotmail.com Mon Oct 1 00:41:27 2018 From: janstapel00 at hotmail.com (Jan Stapel) Date: Sun, 30 Sep 2018 22:41:27 +0000 Subject: [basex-talk] JAVA xquery: accessing documents Message-ID: Hello, Normally (few basex-versions ago) I did: session.execute("open main"); ??? ??? session.execute("xquery doc("users.xml")//users"); But now, this results in basex interpreting the doc()-path as relative to it's? home-directory thus cannot find the resource.. "xquery doc("main/users.xml")//users" gives the correct results. Do we no longer open a database but writing the full path of the document instead? Whats the performance of this if accessing multiple documents of the same database during runtime? -regards, jan From Stephan.vanHugten at theapsgroup.com Mon Oct 1 09:22:59 2018 From: Stephan.vanHugten at theapsgroup.com (Stephan van Hugten) Date: Mon, 1 Oct 2018 07:22:59 +0000 Subject: [basex-talk] REPLACE command issue in Basex version 8.6.6/9.0.2 In-Reply-To: References: <5893c1ff7fc748c3b310d49ac2fff003@APSCLEX001.APSGROUP.LOCAL> Message-ID: Hi Christian, Thank you for your reply. I've tested with the 9.1-SNAPSHOT version and got the following results: > REPLACE com.example.model.user.Account-2397 Chapter 1 resource(s) replaced in 2.89 ms. > REPLACE com.example.model.user.Account-2397 Chapter "com.example.model.user.Account-2397.xml" (Line 1): Open quote is expected for attribute "version" associated with an element type "text". > REPLACE com.example.model.user.Account-2397 "Chapter" "com.example.model.user.Account-2397.xml" (Line 1): Open quote is expected for attribute "version" associated with an element type "text". Not sure that is what I'm expecting. It's good that single quotes now work, but does the Java command REPLACE replace all double quotes by single quotes if an XML string is passed as argument? Kind regards, Stephan -----Original Message----- From: Christian Gr?n [mailto:christian.gruen at gmail.com] Sent: maandag 24 september 2018 15:54 To: Stephan van Hugten Cc: BaseX Subject: Re: [basex-talk] REPLACE command issue in Basex version 8.6.6/9.0.2 Hi Stephan, I remember that another user encountered a similar issue in the recent past. Could you please check out if the problem also happens with the latest stable snapshot [1]? Thanks in advance, Christian [1] http://files.basex.org/releases/latest/ On Mon, Sep 3, 2018 at 3:21 PM Stephan van Hugten wrote: > > In our software we?re using a Basex database and integrate with it via the Java library. We?re currently using 8.0.3, but attempted to upgrade to the latest version (9.0.2) when we encountered a breaking issue. The REPLACE command class now interprets all XML with an attribute as a path. I can reproduce this in the basex command line client, but not the GUI. > > > > Reproducer case: > > > > BaseX 9.0.2 [Client] > > Try 'help' to get more information. > > > create db test > > Database 'test' created in 25.24 ms. > > > open db test > > Database 'db' was not found. > > > open test > > Database 'test' was opened in 1.57 ms. > > > REPLACE com.example.model.user.Account-2397 "Chapter" > > Resource "C:/Java/basex902/bin/"Chapter"" not found. > > > REPLACE com.example.model.user.Account-2397 > version="draft">Chapter > > Resource "C:/Java/basex902/bin/"Chapter"" not found. > > > REPLACE com.example.model.user.Account-2397 > version='draft'>Chapter > > Resource "C:/Java/basex902/bin/"Chapter"" not found. > > > REPLACE "com.example.model.user.Account-2397" > version='draft'>Chapter > > Resource "C:/Java/basex902/bin/"Chapter"" not found. > > > REPLACE "com.example.model.user.Account-2397" "Chapter" > > Resource "C:/Java/basex902/bin/"Chapter"" not found. > > > REPLACE top.xml "Chapter" > > Resource "C:/Java/basex902/bin/"Chapter"" not found. > > > REPLACE top.xml > > 0 resource(s) replaced in 29.71 ms. > > > REPLACE top.xml > > Resource "C:/Java/basex902/bin/""" not found. > > > > > > > Storing the XML in a file and replacing that works: > > > REPLACE com.example.model.user.Account-95 test.xml > > 1 resource(s) replaced in 5.03 ms. > > > xquery //account > > id="10095"> > > > > Can you assist in solving this mystery? > > '********************************************************************* > ***************************** This E-mail and any files transmitted > with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. > > If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. > Any opinions expressed in the E-mail are those of the individual > writer of it and not necessarily the Company unless specifically > stated otherwise. There is no intention to create any legally binding > contract or other commitment through use of this E-mail > > We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. > > Allied Publicity Services (Manchester) Ltd Registered Office: Allied > Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, > Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 > England > > APS Group Secure Solutions Limited. Registered Office: Chetham House, > Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: > 07007434 England APS Group (Scotland) Ltd. Registered Office: APS > Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company > Registration No: SC369510 Scotland > > ______________________________________________________________________ > This email has been scanned by the Symantec Email Security.cloud service. > For more information please visit https://www.symantec.com > ______________________________________________________________________ ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit https://www.symantec.com ______________________________________________________________________ '************************************************************************************************** This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland '************************************************************************************************** This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit https://www.symantec.com ______________________________________________________________________ From michael.wapp at tuwien.ac.at Mon Oct 1 10:15:19 2018 From: michael.wapp at tuwien.ac.at (Michael Wapp) Date: Mon, 1 Oct 2018 10:15:19 +0200 Subject: [basex-talk] BaseX DBA via Docker Message-ID: Hi! I'm not able to access the DBA when the HTTP server is started using docker. The ports are correctly exposed. When accessing localhost:8984/dba, I get the response: /No function found that matches the request./ The docker command I use is the following: /docker run -d \// //??? --name basexhttp \// //??? --publish 1984:1984 \// //??? --publish 8984:8984 \// //??? --volume "$HOME/basex/data":/srv/basex/data \// //??? basex/basexhttp:latest/ Does anybody have an idea what I'm doing wrong? (If this is not the right way to ask questions about BaseX and docker - where else could I find some help?) Kind Regards Michael Wapp -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 1 14:41:33 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 1 Oct 2018 14:41:33 +0200 Subject: [basex-talk] JAVA xquery: accessing documents In-Reply-To: References: Message-ID: Hi Jan, In terms of performance, it?s advisable to open the database in advance if you run several commands on it. Otherwise, you can simply address it via XQuery. If you use fn:doc, the first path segment of the function argument must be the name of your database [1]. db:open will be the safer option, because there won?t be any attempt to find a non-retrievable resource on the local filesystem. Hope this helps, Christian [1] http://docs.basex.org/wiki/Databases#XML_Documents On Mon, Oct 1, 2018 at 12:41 AM Jan Stapel wrote: > > Hello, > > Normally (few basex-versions ago) I did: > > session.execute("open main"); > session.execute("xquery doc("users.xml")//users"); > > But now, this results in basex interpreting the doc()-path as relative > to it's home-directory thus cannot find the resource.. > > "xquery doc("main/users.xml")//users" gives the correct results. > > > Do we no longer open a database but writing the full path of the > document instead? > > Whats the performance of this if accessing multiple documents of the > same database during runtime? > > > -regards, > > jan > > From radim-havlicek at post.cz Mon Oct 1 15:49:24 2018 From: radim-havlicek at post.cz (radim-havlicek at post.cz) Date: Mon, 01 Oct 2018 15:49:24 +0200 (CEST) Subject: [basex-talk] problem with namespace Message-ID: Hello, I have problem with namespace?'www.ni.com/TestStand/ATMLTestResults/3.0'. It works for "return" statement, but when I use a value from this namespace in "where" or "order by" statement, the query returns just an empty string, like no results would have been found, although they exist. In more detail, I have following query: ----------------------------------------------- declare namespace nTestResultsCollection='urn:IEEE-1636.1:2013: TestResultsCollection'; declare namespace nTestResults='urn:IEEE-1636.1:2013:TestResults'; declare namespace nCommon='urn:IEEE-1671:2010:Common'; declare namespace nNi='www.ni.com/TestStand/ATMLTestResults/3.0'; let $DocumentNames := ('Report/89500019-0000-4020-a039-9f53a80d7058', 'Report/89400019-0052-4020-a0f0-e1851b8bbec2', 'Report/00000000-0000-4020-a 093-6c29d4c65c32', 'Report/00000000-0000-4020-a09c-ac632bfa5a7d', 'Report/ 00000000-0000-4020-a09c-ac635023a45c', 'Report/00000000-0000-4020-a09c-ac63e 9c5b490', 'Report/89500019-0051-4020-a170-409bbe8e4f89', 'Report/89500019- 0051-4020-a170-409b334e86c8') for $DocumentName in $DocumentNames let $Document := db:open('ATML',$DocumentName) let $TestSystemItem0 := $Document/nTestResultsCollection: TestResultsCollection/nTestResultsCollection:TestResults/nTestResults: TestStation/nCommon:Definition/nCommon:Identification/nCommon:ModelName/text () let $TestSystemItem1 := $Document/nTestResultsCollection: TestResultsCollection/nTestResultsCollection:TestResults/nTestResults: TestStation/nCommon:Definition/nCommon:Extension/nNi:Items/nNi:Item/Content/ text() let $StartDate := $Document/nTestResultsCollection:TestResultsCollection/ nTestResultsCollection:TestResults/nTestResults:ResultSet/substring-before (data(@startDateTime), 'T') let $StartTime := $Document/nTestResultsCollection:TestResultsCollection/ nTestResultsCollection:TestResults/nTestResults:ResultSet/substring-after (data(@startDateTime), 'T') let $UUID := $Document/nTestResultsCollection:TestResultsCollection/ nTestResultsCollection:TestResults/data(@uuid) let $Serial_Number := $Document/nTestResultsCollection: TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:UUT/ nCommon:SerialNumber/text() let $Part_Number := $Document/nTestResultsCollection:TestResultsCollection/ nTestResultsCollection:TestResults/nTestResults:UUT/nCommon:Definition/data( @name) let $Slot_ID := $Document/nTestResultsCollection:TestResultsCollection/ nTestResultsCollection:TestResults/nTestResults:TestStation/nCommon: Definition/nCommon:Extension/nNi:Items/nNi:Item/Content/text() where (($TestSystemItem1 = 'dx5484')) order by $StartDate, $StartTime return ? { $DocumentName } ? { $TestSystemItem0 } ? { $TestSystemItem1 } ? { $StartDate } ? { $StartTime } ? { $Serial_Number } ? { $Part_Number } ? { $Slot_ID } ? ? ? ?? ? {? ? ? ?? ? ? let $Childs := $Document/nTestResultsCollection:TestResultsCollection/ nTestResultsCollection:TestResults/nTestResults:ResultSet//nTestResults: TestGroup/nTestResults:Test ? ? for $Test in $Childs? ? ? let $TestData := $Test/nTestResults:TestResult/nTestResults:TestData ? ? let $Limits := $Test/nTestResults:TestResult/nTestResults:TestLimits/ nTestResults:Limits ? ? let $TestId := $Test/data(@ID) ? ? let $TestName := $Test/data(@name) ? ? let $TestGroup := $Test/../substring-after(data(@name), '#') ? ? let $TestOutcome := $Test/nTestResults:Outcome/data(@value) ? ? let $Root := $Test/root() ? ? let $RootUuid := $Root/nTestResultsCollection:TestResultsCollection/ nTestResultsCollection:TestResults/data(@uuid) ? ?? ? ? where (($TestName = 'Course Datum MON (7V)' and $TestGroup = 'Course Datum Input Test' and $RootUuid = $UUID)) ? ? return ? ? ? ? ? { $TestData } ? ? ? { $Limits } ? ? ? { $TestId } ? ? ? { $TestName } ? ? ? { $TestGroup } ? ? ? { $TestOutcome } ? ? ? ? ? ? } ? ----------------------------------------------- If I remove the?where (($TestSystemItem1 = 'dx5484'))?statement ($ TestSystemItem1 is from?nNi namespace), it works fine and?TestSystemItem1 values are returned properly in the result in the?{ $ TestSystemItem1 }. However, if I put the?$TestSystemItem1 to the where statement (like in the example above), or to the order by statement, it returns empty result. Is there a way how to fix it? Or is it fixable in the BaseX itself (maybe in the new version)? We cannot change the value of?'www.ni.com/TestStand/ ATMLTestResults/3.0' because the xml files are generated by the 3rd party. Thank you for your help in advance. Best regards, Radim Havlicek -------------- next part -------------- An HTML attachment was scrubbed... URL: From radu_coravu at sync.ro Mon Oct 1 16:16:11 2018 From: radu_coravu at sync.ro (Radu Coravu) Date: Mon, 1 Oct 2018 17:16:11 +0300 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? Message-ID: Hi Christian, Jason, Coming back to this older discussion thread. How does baseX parse XML document, does it do so using the regular "javax.xml.parsers.SAXParserFactory" factory? In this folder there is a JAR library called "dita-ng.jar": https://github.com/oxygenxml/dita-relaxng-defaults/tree/master/lib inside the JAR library's META-INF folder there is a "services" folder in which the JAR library registers a custom "org.apache.xerces.xni.parser.XMLParserConfiguration". If this parser configuration is used when parsing XML documents, and XML documents have references to Relax NG documents, the default attributes defined in the Relax NG schema would start being reported on SAX and DOM parsers parsing the XML documents. But the "xercesImpl.jar" registers the same "org.apache.xerces.xni.parser.XMLParserConfiguration" service. So in order to test if RNG-based XML parsing works with BaseX we would somehow need a way to add the "dita-ng.jar" to the baseX server's class path but it should also come in the classpath before the "xercesImpl.jar". But this would work only if the baseX code uses the "javax.xml.parsers.SAXParserFactory" when parsing XML documents instead of using directly implementations from the Xerces library. Regards, Radu Radu Coravu XML Editor http://www.oxygenxml.com > Hi Christian, > > Thanks for your response. Understood with regard to Jing. The plugin I linked > also uses Jing. I'm just not clear which version. I believe the source for at > least the dita-ng.jar is linked from the repository [1]. > > > With regard to the questions asked in this post, after investigation, I > believe I have a better understanding of the problem I'm trying to solve. > Importing Relzx NG XML into the database was not the problem. The problem > exists between the database and the application layer that interfaces with it. > I opened a feature request that summarizes it [2]. > > Thanks, > Jason > > [1] https://github.com/georgebina/dita-ng > [2] https://github.com/BaseXdb/basex/issues/1624 > > ?On 9/25/18, 12:38 AM, "Christian Gr?n" wrote: > > Hi Jason, > > Please note that BaseX uses the Jing RELAX NG validator. It does not > embed the DITA Open Toolkit. > > I didn?t have time to look at the DITA OT plugin so far. It seems that > the repository of the oXygen plugin you referenced only contains the > JAR file. Do you possibly know where we can find the source files? > > Cheers > Christian > > PS: It seems that you and your colleague asked different questions in > your previous posts. Have these questions been solved? > > > > On Mon, Sep 17, 2018 at 9:55 PM Jason Davis > wrote: > > > > My mistake. It appears I may have misstated my problem. The query I used > worked fine for importing resources. The problem appears to be related to how > BaseX parses the resources. It doesn?t appear to take into account default > attribute values. Given that the Relax NG spec clearly states default > attributes are not part of the design, this doesn?t come across as a surprise. > However, default attributes are meaningful with regard to DITA and there is a > Java framework you can install as a plugin to the DITA Open Toolkit that > supports parsing of Relax NG DITA content with default attributes [1]. > > > > Is it possible to setup databases created in BaseX with Relax NG parsing > of default attributes? Is it just a matter of including the dita-ng.jar from > the DITA OT plugin in my classpath? > > > > Thanks, > > Jason > > > > [1] https://github.com/oxygenxml/dita-relaxng-defaults > > > From christian.gruen at gmail.com Mon Oct 1 18:29:37 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 1 Oct 2018 18:29:37 +0200 Subject: [basex-talk] REPLACE command issue in Basex version 8.6.6/9.0.2 In-Reply-To: References: <5893c1ff7fc748c3b310d49ac2fff003@APSCLEX001.APSGROUP.LOCAL> Message-ID: Hi Stephan, Thanks for testing. I?m glad to hear that the bug you encountered seems to have been fixed. Some background information regarding the general handling of quotes in command arguments: In earlier days, the only way to pass on multiple commands to BaseX on command line was to separate them with semicolons. An example: > basex -c "create db test ; xquery ." As a consequence, argument parsing imposed various restrictions (quotes were removed, semicolons served as end-of-command delimiters), and input to be replaced was usually supplied via file paths or via one of the other APIs. This is not valid anymore in more recent versions, however, as you can now specify multiple arguments one by one: > basex -c "create db test " -c "xquery ." I have just revised our command string parser. With the very latest snapshot, the commands? > REPLACE path > REPLACE path > REPLACE path "" ...should now be parsed as expected. Optional double quotes at the start and the end of your argument will be removed, but I haven?t included support for escaping double quotes, because the backslashes might be an intentional part of the XML input. Instead, I recommend you to simply go with version 1. Cheers, Christian On Mon, Oct 1, 2018 at 9:23 AM Stephan van Hugten wrote: > > Hi Christian, > > Thank you for your reply. I've tested with the 9.1-SNAPSHOT version and got the following results: > > > REPLACE com.example.model.user.Account-2397 Chapter > 1 resource(s) replaced in 2.89 ms. > > REPLACE com.example.model.user.Account-2397 Chapter > "com.example.model.user.Account-2397.xml" (Line 1): Open quote is expected for attribute "version" associated with an element type "text". > > REPLACE com.example.model.user.Account-2397 "Chapter" > "com.example.model.user.Account-2397.xml" (Line 1): Open quote is expected for attribute "version" associated with an element type "text". > > Not sure that is what I'm expecting. It's good that single quotes now work, but does the Java command REPLACE replace all double quotes by single quotes if an XML string is passed as argument? > > Kind regards, > > Stephan From christian.gruen at gmail.com Mon Oct 1 20:04:29 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 1 Oct 2018 20:04:29 +0200 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: Hi Radu, How does baseX parse XML document, does it do so using the regular > "javax.xml.parsers.SAXParserFactory" factory? > Yes, it does [1]! So in order to test if RNG-based XML parsing works with BaseX we would > somehow need a way to add the "dita-ng.jar" to the baseX server's class > path but it should also come in the classpath before the "xercesImpl.jar". > Currently, there is no particular order in which libraries are imported [2], but if the chosen order is wrong, the dita-ng.jar could be added manually to the start script. Hope this helps, Christian [1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/io/parse/xml/XmlParser.java [2] https://github.com/BaseXdb/basex/blob/master/basex-core/etc/basex -------------- next part -------------- An HTML attachment was scrubbed... URL: From radu_coravu at sync.ro Tue Oct 2 08:53:03 2018 From: radu_coravu at sync.ro (Radu Coravu) Date: Tue, 2 Oct 2018 09:53:03 +0300 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: <817434a3-db63-66ef-70b3-33bc71ed335f@sync.ro> Hi Christian, Thanks for the help. Regards, Radu Radu Coravu XML Editor http://www.oxygenxml.com On 10/1/2018 9:04 PM, Christian Gr?n wrote: > Hi Radu, > > How does baseX parse XML document, does it do so using the regular > "javax.xml.parsers.SAXParserFactory" factory? > > > Yes, it does [1]! > > So in order to test if RNG-based XML parsing works with BaseX we would > somehow need a way to add the "dita-ng.jar" to the baseX server's class > path but it should also come in the classpath before the > "xercesImpl.jar". > > > Currently, there is no particular order in which libraries are imported > [2], but if the chosen order is wrong, the dita-ng.jar could be added > manually to the start script. > > Hope this helps, > Christian > > [1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/io/parse/xml/XmlParser.java > [2] https://github.com/BaseXdb/basex/blob/master/basex-core/etc/basex > > From christian.gruen at gmail.com Tue Oct 2 13:33:48 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Tue, 2 Oct 2018 13:33:48 +0200 Subject: [basex-talk] problem with namespace In-Reply-To: References: Message-ID: Hi Radim, Thanks for the observation. Could you possibly provide us a little self-contained example (e.g. with a single document that we can use for creating a database) and drop the lines of code that are not necessary to understand the problem? Thanks in advance, Christian On Mon, Oct 1, 2018 at 3:49 PM wrote: > > Hello, > > I have problem with namespace 'www.ni.com/TestStand/ATMLTestResults/3.0'. It works for "return" statement, but when I use a value from this namespace in "where" or "order by" statement, the query returns just an empty string, like no results would have been found, although they exist. > > In more detail, I have following query: > ----------------------------------------------- > > declare namespace nTestResultsCollection='urn:IEEE-1636.1:2013:TestResultsCollection'; > declare namespace nTestResults='urn:IEEE-1636.1:2013:TestResults'; > declare namespace nCommon='urn:IEEE-1671:2010:Common'; > declare namespace nNi='www.ni.com/TestStand/ATMLTestResults/3.0'; > > let $DocumentNames := ('Report/89500019-0000-4020-a039-9f53a80d7058', 'Report/89400019-0052-4020-a0f0-e1851b8bbec2', 'Report/00000000-0000-4020-a093-6c29d4c65c32', 'Report/00000000-0000-4020-a09c-ac632bfa5a7d', 'Report/00000000-0000-4020-a09c-ac635023a45c', 'Report/00000000-0000-4020-a09c-ac63e9c5b490', 'Report/89500019-0051-4020-a170-409bbe8e4f89', 'Report/89500019-0051-4020-a170-409b334e86c8') > for $DocumentName in $DocumentNames > let $Document := db:open('ATML',$DocumentName) > let $TestSystemItem0 := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:TestStation/nCommon:Definition/nCommon:Identification/nCommon:ModelName/text() > let $TestSystemItem1 := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:TestStation/nCommon:Definition/nCommon:Extension/nNi:Items/nNi:Item/Content/text() > let $StartDate := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:ResultSet/substring-before(data(@startDateTime), 'T') > let $StartTime := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:ResultSet/substring-after(data(@startDateTime), 'T') > let $UUID := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/data(@uuid) > let $Serial_Number := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:UUT/nCommon:SerialNumber/text() > let $Part_Number := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:UUT/nCommon:Definition/data(@name) > let $Slot_ID := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:TestStation/nCommon:Definition/nCommon:Extension/nNi:Items/nNi:Item/Content/text() > > > where (($TestSystemItem1 = 'dx5484')) > order by $StartDate, $StartTime > > return > > { $DocumentName } > { $TestSystemItem0 } > { $TestSystemItem1 } > { $StartDate } > { $StartTime } > { $Serial_Number } > { $Part_Number } > { $Slot_ID } > > > > > { > let $Childs := $Document/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/nTestResults:ResultSet//nTestResults:TestGroup/nTestResults:Test > for $Test in $Childs > let $TestData := $Test/nTestResults:TestResult/nTestResults:TestData > let $Limits := $Test/nTestResults:TestResult/nTestResults:TestLimits/nTestResults:Limits > let $TestId := $Test/data(@ID) > let $TestName := $Test/data(@name) > let $TestGroup := $Test/../substring-after(data(@name), '#') > let $TestOutcome := $Test/nTestResults:Outcome/data(@value) > let $Root := $Test/root() > let $RootUuid := $Root/nTestResultsCollection:TestResultsCollection/nTestResultsCollection:TestResults/data(@uuid) > > > where (($TestName = 'Course Datum MON (7V)' and $TestGroup = 'Course Datum Input Test' and $RootUuid = $UUID)) > return > > { $TestData } > { $Limits } > { $TestId } > { $TestName } > { $TestGroup } > { $TestOutcome } > > > > } > > > > > ----------------------------------------------- > > If I remove the where (($TestSystemItem1 = 'dx5484')) statement ($TestSystemItem1 is from nNi namespace), it works fine and TestSystemItem1 values are returned properly in the result in the { $TestSystemItem1 }. However, if I put the $TestSystemItem1 to the where statement (like in the example above), or to the order by statement, it returns empty result. > > Is there a way how to fix it? Or is it fixable in the BaseX itself (maybe in the new version)? We cannot change the value of 'www.ni.com/TestStand/ATMLTestResults/3.0' because the xml files are generated by the 3rd party. > > Thank you for your help in advance. > Best regards, > > Radim Havlicek From christian.gruen at gmail.com Tue Oct 2 13:37:41 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Tue, 2 Oct 2018 13:37:41 +0200 Subject: [basex-talk] JAVA xquery: accessing documents In-Reply-To: References: Message-ID: Hi Jan (cc to the list), > why is doc("users.xml") not working although the database has been > opened before? It says "resource 'home/jan/..../users.xml not found'.. > > doc("main/users.xml") is working. See the following lines in our documentation: If the argument of fn:doc or fn:collection does not start with a valid database name, or if the addressed database does not exist, the string is interpreted as URI reference, and the documents found at this location will be returned. If the DEFAULTDB option is turned on, the path argument of the fn:doc or fn:collection function will first be resolved against the globally opened database. Hope this helps, Christian From bjoern.braunschweig at gwdg.de Tue Oct 2 14:19:00 2018 From: bjoern.braunschweig at gwdg.de (=?utf-8?B?QnJhdW5zY2h3ZWlnLCBCasO2cm4=?=) Date: Tue, 2 Oct 2018 12:19:00 +0000 Subject: [basex-talk] BaseX DBA via Docker In-Reply-To: References: Message-ID: <094f335579994432b78bbd7ea4e3a7b7@gwdg.de> Dear Michael, By running: docker run -d --network mybasex-net --name basex-dba --publish 18984:8984 --link basex:basexhttp basex/dba I am able to access the dba interface via http://myhost:18984/dba/login Regards, Bj?rn Von: BaseX-Talk Im Auftrag von Michael Wapp Gesendet: Montag, 1. Oktober 2018 10:15 An: basex-talk at mailman.uni-konstanz.de Betreff: [basex-talk] BaseX DBA via Docker Hi! I'm not able to access the DBA when the HTTP server is started using docker. The ports are correctly exposed. When accessing localhost:8984/dba, I get the response: No function found that matches the request. The docker command I use is the following: docker run -d \ --name basexhttp \ --publish 1984:1984 \ --publish 8984:8984 \ --volume "$HOME/basex/data":/srv/basex/data \ basex/basexhttp:latest Does anybody have an idea what I'm doing wrong? (If this is not the right way to ask questions about BaseX and docker - where else could I find some help?) Kind Regards Michael Wapp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7663 bytes Desc: not available URL: From christian.gruen at gmail.com Wed Oct 3 12:23:49 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Wed, 3 Oct 2018 12:23:49 +0200 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: Hi Jason (cc to the list), > I set the CP variable like so: > CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH > > This appears to be slightly different than the example you linked Christian. I?m using BaseX 9.0.2. Does this make a difference? The start scripts in the official distributions are created from the GitHub examples I linked, so they are slightly different. > I added an echo $CLASSPATH line under the CP variable. When I run the script, the echo statement is blank. In the script, no value will be bound to the $CLASSPATH variable. Instead, you can assign values to this variable by yourself, which will then be appended to the $CP variable. If you didn?t do so, and if your Linux environment does not have any other values assigned to this variable (which is the default), the output will necessarily be empty. > Is there a way to see how the classpath is set when running this script? To answer the "how": It will be set via the line that you will find some lines below in the script, and the -cp Java argument: exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@" If you want to know which value is bound to $CP, try "echo $CP". In Java, the full user class path at runtime will be bound to the "java.class.path" system property. It can e.g. be retrieved via proc:property('java.class.path') [1]. Christian [1] http://docs.basex.org/wiki/Process_Module#proc:property From mixich.andreas at gmail.com Fri Oct 5 22:46:50 2018 From: mixich.andreas at gmail.com (Andreas Mixich) Date: Fri, 5 Oct 2018 22:46:50 +0200 Subject: [basex-talk] Dynamic value for collation in FLWOR? Message-ID: Hi, this: for $i in $item let $lang := concat("?lang=", $item/@xml:lang/string()) order by $i collation $lang return $i does not work: "[XPST0003] Expecting quote, found '$'." Any way to do this dynamically? Wouldn't order by $i collation $item/@xml:lang/string() make sense? -- Goody Bye, Minden j?t, Mit freundlichen Gr??en, Andreas Mixich From christian.gruen at gmail.com Fri Oct 5 23:01:04 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Fri, 5 Oct 2018 23:01:04 +0200 Subject: [basex-talk] Dynamic value for collation in FLWOR? In-Reply-To: References: Message-ID: Hi Andreas, the fn:sort function [1] allows you to specify a dynamic collation string. Note, however, that you can only specify one collation string per sort operation, just as you cannot change any other sort property (such as e.g. the sort order) in a single sort. Best, Christian [1] http://docs.basex.org/wiki/XQuery_3.1#fn:sort Andreas Mixich schrieb am Fr., 5. Okt. 2018, 22:46: > Hi, > > this: > > for $i in $item > let $lang := concat("?lang=", $item/@xml:lang/string()) > order by $i collation $lang > return $i > > does not work: "[XPST0003] Expecting quote, found '$'." > Any way to do this dynamically? > > Wouldn't > > order by $i collation $item/@xml:lang/string() > > make sense? > > -- > Goody Bye, Minden j?t, Mit freundlichen Gr??en, > Andreas Mixich > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdysonsmith at gmail.com Mon Oct 8 02:39:08 2018 From: bdysonsmith at gmail.com (Bridger Dyson-Smith) Date: Sun, 7 Oct 2018 20:39:08 -0400 Subject: [basex-talk] Output `out:format` function question Message-ID: Hi all - I'm confused about some notation in the `out:format`[1] signature. In the wiki, I see out:format($format as xs:string, $item1 as item(), ...) as xs:string and in v9.0.2 (and the latest v9.1 beta) GUI, I see the following info: out:format(format,item1[,...]) But I'm confused by the `[,...]`. What does this mean? I've tried the following: out:format("%06d", 256) -> 000256 (: stolen from the wiki :) out:format("%06d", 256, 367) -> 000256 (: the second item() is ignored :) let $n := 256 out:format("%06d", $n) -> IllegalFormatConversionException: java.util.IllegalFormatConversionException: d != java.lang.String. I'm weak on my data model types for sure, but how should the signature here be interpreted? Thanks for your help! Best, Bridger [1] http://docs.basex.org/wiki/Output_Module#out:format -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.lettere at gmail.com Mon Oct 8 09:24:51 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Mon, 8 Oct 2018 09:24:51 +0200 Subject: [basex-talk] Output `out:format` function question In-Reply-To: References: Message-ID: On 08/10/2018 02:39, Bridger Dyson-Smith wrote: > out:format("%06d", 256, 367) -> 000256 (: the second item() is ignored :) Hi Dyson, as far as I understand regarding this example the number of handled items depends on the format string. out:format("%06d %06d", 256, 367) would probably output what you expect. Regards, Marco. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdysonsmith at gmail.com Mon Oct 8 15:31:53 2018 From: bdysonsmith at gmail.com (Bridger Dyson-Smith) Date: Mon, 8 Oct 2018 09:31:53 -0400 Subject: [basex-talk] Output `out:format` function question In-Reply-To: References: Message-ID: Marco - On Mon, Oct 8, 2018 at 3:24 AM Marco Lettere wrote: > On 08/10/2018 02:39, Bridger Dyson-Smith wrote: > > out:format("%06d", 256, 367) -> 000256 (: the second item() is ignored :) > > Hi Dyson, > > as far as I understand regarding this example the number of handled items > depends on the format string. > > out:format("%06d %06d", 256, 367) > > would probably output what you expect. > It absolutely does - thank you for the helpful clarification! > Regards, > > Marco. > Best, Bridger -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.lettere at gmail.com Wed Oct 10 10:57:06 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Wed, 10 Oct 2018 10:57:06 +0200 Subject: [basex-talk] Tomcat & services Message-ID: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> Dear all, has anyone experience with exploiting the persistent jobs (services) feature under Tomcat? We have installed services with the proper jobs.xml file. When running jobs:services() in the DBA after startup, we get the services listed. Nevertheless none of the XQuery scripts inside the jobs is executed at startup of the Tomcat. When running standalone with Jetty, the scripts are executed even if, in this case, we are getting empty results when running jobs:services() in the DBA after startup. Any clue on what we should double-check? Thanks, Marco. From dharam.mahi at gmail.com Thu Oct 11 14:43:59 2018 From: dharam.mahi at gmail.com (DK Singh) Date: Thu, 11 Oct 2018 18:13:59 +0530 Subject: [basex-talk] Change the default user and its Password Message-ID: Hi All, I have to change the default user credential of BaseX where should i made the changes, when i access the url "http://localhost:8984/dba" now it opens with the default credentials which is "admin" now i have to change it, i have made the changes in the web.xml org.basex.user dharmendra but it is not working still it is taking the default credentials. Regards Dharmendra Kumar Singh -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.kopecek at gmail.com Sun Oct 14 00:10:12 2018 From: dave.kopecek at gmail.com (Dave Kopecek) Date: Sat, 13 Oct 2018 18:10:12 -0400 Subject: [basex-talk] Database Updates In-Reply-To: References: Message-ID: Here are some tweaked examples & better problem definition: Given a database created from catalog.xml below, what's the best way to update & add records received daily as in file daily-update.xml? For every node in daily-update.xml -- If ENTRY/SKU found in catalog.xml replace the entire node in catalog.xml with the one from daily-update.xml -- If ENTRY/SKU not found in catalog.xml add the node from daily-update.xml to catalog.xml catalog.xml 1 Empire Burlesque Dylan 10.90 2 Hide your heart Bonnie Tyler 9.90 daily-update.xml 1 Empire Burlesque Bob Dylan 29.99 some value 5 Tupelo Honey Van Morrison 8.20 catalog.xml after daily update: 1 Empire Burlesque Bob Dylan 29.99 some value 2 Hide your heart Bonnie Tyler 9.90 5 Tupelo Honey Van Morrison 8.20 Thanks, -Dave On Fri, Aug 17, 2018 at 11:27 AM Dave Kopecek wrote: > Hi All, > > Given a database created from catalog.xml below. What's the best way to > update & add records received daily as in file daily-update.xml ? > > Coming from relational DBs & new to this. I ultimately need to > script/automate this. Hoping there's some magic command I'm missing & > looking for best way to approach the problem. > > Thanks, > -Dave > > > catalog.xml > > > > > 1 > Empire Burlesque > Dylan > 10.90 > > > 2 > Hide your heart > Bonnie Tyler > 9.90 > > > > > daily-update.xml > > > > > 1 > 19.90 > I wasn't here before the update > > > 1971 > Tupelo Honey > Van Morrison > 8.20 > > > > > -- *DAVE KOPECEK* OFFICE 607-431-8565 CELL *607-267-3449* 6 CROSS STREET, DELHI NY 13753 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fetanchaud at pch.cerfrance.fr Mon Oct 15 09:50:01 2018 From: fetanchaud at pch.cerfrance.fr (Fabrice ETANCHAUD) Date: Mon, 15 Oct 2018 07:50:01 +0000 Subject: [basex-talk] Database Updates In-Reply-To: References: Message-ID: Hi Dave, Like you, because of my RDBMS background, I had to feel the ?document? paradigm in order to obtain good performance results. I suggest you do not try to update your catalog document in place using XQuery Update facility. A simple solution is to add each daily-update, and annotate it with a my-sort-value value you can sort on (the date in your use case). When looking for a given SKU, use an index to obtain the list of entry elements, ordered by descending my-sort-value, and take the first item. When you hit performance or storage limits, create a collection containing only the latest version of each entry element. But as your data is not really document oriented, did you consider using JSON repositories like couchbase ? You could choose to store each entry element in a separate document with SKU as key. Coupled with just a little preprocessing step - that could be written easly in XQuery - transforming your entries element in a JSON array of entry objects, you will obtain incredible performance. Couchbase as a ?SQL like? language to query your bucket of documents called N1QL. Best regards, Fabrice De : BaseX-Talk [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Dave Kopecek Envoy? : dimanche 14 octobre 2018 00:10 ? : basex-talk at mailman.uni-konstanz.de Objet : Re: [basex-talk] Database Updates Here are some tweaked examples & better problem definition: Given a database created from catalog.xml below, what's the best way to update & add records received daily as in file daily-update.xml? For every node in daily-update.xml -- If ENTRY/SKU found in catalog.xml replace the entire node in catalog.xml with the one from daily-update.xml -- If ENTRY/SKU not found in catalog.xml add the node from daily-update.xml to catalog.xml catalog.xml 1 Empire Burlesque Dylan 10.90 2 Hide your heart Bonnie Tyler 9.90 daily-update.xml 1 Empire Burlesque Bob Dylan 29.99 some value 5 Tupelo Honey Van Morrison 8.20 catalog.xml after daily update: 1 Empire Burlesque Bob Dylan 29.99 some value 2 Hide your heart Bonnie Tyler 9.90 5 Tupelo Honey Van Morrison 8.20 Thanks, -Dave On Fri, Aug 17, 2018 at 11:27 AM Dave Kopecek > wrote: Hi All, Given a database created from catalog.xml below. What's the best way to update & add records received daily as in file daily-update.xml ? Coming from relational DBs & new to this. I ultimately need to script/automate this. Hoping there's some magic command I'm missing & looking for best way to approach the problem. Thanks, -Dave catalog.xml 1 Empire Burlesque Dylan 10.90 2 Hide your heart Bonnie Tyler 9.90 daily-update.xml 1 19.90 I wasn't here before the update 1971 Tupelo Honey Van Morrison 8.20 -- DAVE KOPECEK OFFICE 607-431-8565 CELL 607-267-3449 6 CROSS STREET, DELHI NY 13753 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 15 15:07:14 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 15 Oct 2018 15:07:14 +0200 Subject: [basex-talk] Database Updates In-Reply-To: References: Message-ID: Hi Dave, here is one way to do it: declare context item := db:open('catalog'); declare variable $update := 'daily-update.xml'; for $new in doc($update)//ENTRY let $old := //ENTRY[SKU = $new/SKU] return if($old) then ( replace node $old with $new ) else ( insert node $new into /CATALOG/ENTRIES ) Hope this helps, Christian On Sun, Oct 14, 2018 at 12:10 AM Dave Kopecek wrote: > > Here are some tweaked examples & better problem definition: > > Given a database created from catalog.xml below, what's the best way to update & add records received daily as in file daily-update.xml? > > For every node in daily-update.xml > -- If ENTRY/SKU found in catalog.xml replace the entire node in catalog.xml with the one from daily-update.xml > -- If ENTRY/SKU not found in catalog.xml add the node from daily-update.xml to catalog.xml > > catalog.xml > > > > > 1 > Empire Burlesque > Dylan > 10.90 > > > 2 > Hide your heart > Bonnie Tyler > 9.90 > > > > > daily-update.xml > > > > > 1 > Empire Burlesque > Bob Dylan > 29.99 > some value > > > 5 > Tupelo Honey > Van Morrison > 8.20 > > > > > catalog.xml after daily update: > > > > 1 > Empire Burlesque > Bob Dylan > 29.99 > some value > > > 2 > Hide your heart > Bonnie Tyler > 9.90 > > > 5 > Tupelo Honey > Van Morrison > 8.20 > > > > > Thanks, > -Dave > > On Fri, Aug 17, 2018 at 11:27 AM Dave Kopecek wrote: >> >> Hi All, >> >> Given a database created from catalog.xml below. What's the best way to update & add records received daily as in file daily-update.xml ? >> >> Coming from relational DBs & new to this. I ultimately need to script/automate this. Hoping there's some magic command I'm missing & looking for best way to approach the problem. >> >> Thanks, >> -Dave >> >> >> catalog.xml >> >> >> >> >> 1 >> Empire Burlesque >> Dylan >> 10.90 >> >> >> 2 >> Hide your heart >> Bonnie Tyler >> 9.90 >> >> >> >> >> daily-update.xml >> >> >> >> >> 1 >> 19.90 >> I wasn't here before the update >> >> >> 1971 >> Tupelo Honey >> Van Morrison >> 8.20 >> >> >> >> > > > -- > DAVE KOPECEK OFFICE 607-431-8565 CELL 607-267-3449 > 6 CROSS STREET, DELHI NY 13753 From christian.gruen at gmail.com Mon Oct 15 15:25:33 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 15 Oct 2018 15:25:33 +0200 Subject: [basex-talk] Tomcat & services In-Reply-To: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> Message-ID: Hi Marco, I see your question didn?t get an answer yet. Maybe we can first try to find out what Jetty does (or does not): > When running standalone with Jetty, the scripts are executed even if, in > this case, we are getting empty results when running jobs:services() in > the DBA after startup. Some questions back: 1. By 'standalone', do you mean that you are running 'basexhttp', or do you run Jetty and deploy BaseX as WAR file? 2. How does the jobs.xml file in the database directory look like? Cheers, Christian From m.lettere at gmail.com Mon Oct 15 15:38:51 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Mon, 15 Oct 2018 15:38:51 +0200 Subject: [basex-talk] Tomcat & services In-Reply-To: References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> Message-ID: <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> Hi Christian, thank you as usual for your attention. With standalone I mean basexhttp which is what we usually do. This time we have requirement for running inside tomcat... The jobs.xml file looks like: if (db:exists('onedb')) then () else db:create('ondedb') but we have also tried with: admin:write-log(current-dateTime()) which presents the exact same issues: basexhttp runs ok but jobs:services() doesn't list them whereas tomcat doesn't run the scripts but services are listed. Thank you again, Marco. On 15/10/2018 15:25, Christian Gr?n wrote: > Hi Marco, > > I see your question didn?t get an answer yet. Maybe we can first try > to find out what Jetty does (or does not): > >> When running standalone with Jetty, the scripts are executed even if, in >> this case, we are getting empty results when running jobs:services() in >> the DBA after startup. > Some questions back: > 1. By 'standalone', do you mean that you are running 'basexhttp', or > do you run Jetty and deploy BaseX as WAR file? > 2. How does the jobs.xml file in the database directory look like? > > Cheers, > Christian From christian.gruen at gmail.com Mon Oct 15 16:59:09 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 15 Oct 2018 16:59:09 +0200 Subject: [basex-talk] Tomcat & services In-Reply-To: <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> Message-ID: Hi Marco, I tried to reproduce the problem: 1. I downloaded http://files.basex.org/releases/9.0.2/BaseX902.zip 2. I unzipped the archive 3. I added a jobs.xml file in the basex/data directory: admin:write-log('!') 4. I started basexhttp 5. As expected, the log entry is listed in the DBA logs panel. 6. jobs:services() returns admin:write-log('!') Could you do the same and report back to us what you did differently? Thanks in advance Christian > Hi Christian, > thank you as usual for your attention. > With standalone I mean basexhttp which is what we usually do. This time > we have requirement for running inside tomcat... > The jobs.xml file looks like: > > > if (db:exists('onedb')) then () else > db:create('ondedb') > > > but we have also tried with: > > > admin:write-log(current-dateTime()) > > > which presents the exact same issues: basexhttp runs ok but > jobs:services() doesn't list them whereas tomcat doesn't run the scripts > but services are listed. > Thank you again, > Marco. > > On 15/10/2018 15:25, Christian Gr?n wrote: > > Hi Marco, > > > > I see your question didn?t get an answer yet. Maybe we can first try > > to find out what Jetty does (or does not): > > > >> When running standalone with Jetty, the scripts are executed even if, in > >> this case, we are getting empty results when running jobs:services() in > >> the DBA after startup. > > Some questions back: > > 1. By 'standalone', do you mean that you are running 'basexhttp', or > > do you run Jetty and deploy BaseX as WAR file? > > 2. How does the jobs.xml file in the database directory look like? > > > > Cheers, > > Christian > > From jason.davis at hortonworks.com Mon Oct 15 17:46:12 2018 From: jason.davis at hortonworks.com (Jason Davis) Date: Mon, 15 Oct 2018 15:46:12 +0000 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: Hi Christian, Radu, I?ve tried adding the dita-ng.jar to the lib/custom dir of basex and then manually modified the startup script to load it first. I can even confirm that it?s the first jar on the path using: proc:property('java.class.path') However, the database still fails to parse the XML with default attributes applied. I find myself having to cobble together an undesirable workaround whereby I manually supply the default attribute values myself in order to get my project to work with BaseX. Do you have any further suggestions for how I might get this to work? Thanks, Jason ?On 10/3/18, 3:24 AM, "Christian Gr?n" wrote: Hi Jason (cc to the list), > I set the CP variable like so: > CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH > > This appears to be slightly different than the example you linked Christian. I?m using BaseX 9.0.2. Does this make a difference? The start scripts in the official distributions are created from the GitHub examples I linked, so they are slightly different. > I added an echo $CLASSPATH line under the CP variable. When I run the script, the echo statement is blank. In the script, no value will be bound to the $CLASSPATH variable. Instead, you can assign values to this variable by yourself, which will then be appended to the $CP variable. If you didn?t do so, and if your Linux environment does not have any other values assigned to this variable (which is the default), the output will necessarily be empty. > Is there a way to see how the classpath is set when running this script? To answer the "how": It will be set via the line that you will find some lines below in the script, and the -cp Java argument: exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@" If you want to know which value is bound to $CP, try "echo $CP". In Java, the full user class path at runtime will be bound to the "java.class.path" system property. It can e.g. be retrieved via proc:property('java.class.path') [1]. Christian [1] http://docs.basex.org/wiki/Process_Module#proc:property From m.lettere at gmail.com Mon Oct 15 17:47:09 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Mon, 15 Oct 2018 17:47:09 +0200 Subject: [basex-talk] Tomcat & services In-Reply-To: References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> Message-ID: <29e646f8-1608-cab2-0740-4cf74d067a33@gmail.com> Ok, actually on my personal PC jobs are correctly listed also with basexhttp (need to investigate why on my colleagues PC this doesn't work). Back to the more important issue... I put the following jobs.xml[1] file in the data folder and get [2] as first lines of log in dba after reboot. I put the same file into the "dbpath" folder of my app running as tomcat webapp but the log looks like [3]. The feeling is that services are scheduled only in accordance to the startup of the http server which doesn't occur when running inside Tomcat. In general we think that when working with tomcat one usually has to link an external dbpath in order to avoid getting his data removed when redeploying the webapp. The requirement to put jobs.xml inside the datapath somehow breaks the atomicity of a deployable webapp. A workaround could be to have the jobs.xml somehow redefined as a web.xml variable. Might this be possible? Thanks for your support. M. [1] ? admin:write-log('!') ? admin:write-log("1=1") [2] 17:39:05.100 0:0:0:0:0:0:0:1:42740 admin 302 745.90 [GET] http://localhost:8984/dba 17:39:02.715 SERVER admin INFO NaN ! 17:39:02.715 SERVER admin INFO NaN 1=1 17:39:02.468 SERVER admin OK NaN HTTP Server was started (port: 8984). 17:39:02.454 SERVER admin OK NaN Server was started (port: 1984). [3] 17:29:04.933 0:0:0:0:0:0:0:1:52332 admin 302 1497.81 [GET] http://localhost:8081/contract-repository/dba 17:28:43.218 SERVER admin OK NaN Server was started (port: 1984). On 15/10/2018 16:59, Christian Gr?n wrote: > Hi Marco, > > I tried to reproduce the problem: > > 1. I downloaded http://files.basex.org/releases/9.0.2/BaseX902.zip > 2. I unzipped the archive > 3. I added a jobs.xml file in the basex/data directory: > > > admin:write-log('!') > > > 4. I started basexhttp > 5. As expected, the log entry is listed in the DBA logs panel. > 6. jobs:services() returns admin:write-log('!') > > Could you do the same and report back to us what you did differently? > > Thanks in advance > Christian > > > > >> Hi Christian, >> thank you as usual for your attention. >> With standalone I mean basexhttp which is what we usually do. This time >> we have requirement for running inside tomcat... >> The jobs.xml file looks like: >> >> >> if (db:exists('onedb')) then () else >> db:create('ondedb') >> >> >> but we have also tried with: >> >> >> admin:write-log(current-dateTime()) >> >> >> which presents the exact same issues: basexhttp runs ok but >> jobs:services() doesn't list them whereas tomcat doesn't run the scripts >> but services are listed. >> Thank you again, >> Marco. >> >> On 15/10/2018 15:25, Christian Gr?n wrote: >>> Hi Marco, >>> >>> I see your question didn?t get an answer yet. Maybe we can first try >>> to find out what Jetty does (or does not): >>> >>>> When running standalone with Jetty, the scripts are executed even if, in >>>> this case, we are getting empty results when running jobs:services() in >>>> the DBA after startup. >>> Some questions back: >>> 1. By 'standalone', do you mean that you are running 'basexhttp', or >>> do you run Jetty and deploy BaseX as WAR file? >>> 2. How does the jobs.xml file in the database directory look like? >>> >>> Cheers, >>> Christian >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 15 17:56:57 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 15 Oct 2018 17:56:57 +0200 Subject: [basex-talk] Tomcat & services In-Reply-To: <29e646f8-1608-cab2-0740-4cf74d067a33@gmail.com> References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> <29e646f8-1608-cab2-0740-4cf74d067a33@gmail.com> Message-ID: Thanks for your summary on the behavior of Tomcat. > In general we think that when working with tomcat one usually has to link an external dbpath in order to avoid getting his data removed when redeploying the webapp. The requirement to put jobs.xml inside the datapath somehow breaks the atomicity of a deployable webapp. > A workaround could be to have the jobs.xml somehow redefined as a web.xml variable. Might this be possible? To understand your use case better: 1. Do you currently define an external database path when working with Tomcat? 2. Would you prefer to have a servlet-specific jobs.xml file and an external database directory, or should both of them be placed internally or externally? Just a guess, but maybe it would generally be a good idea to be able to define an external database directory for Tomcat? Or would you indeed like to have servlet-specific databases removod if On Mon, Oct 15, 2018 at 5:47 PM Marco Lettere wrote: > Ok, actually on my personal PC jobs are correctly listed also with > basexhttp (need to investigate why on my colleagues PC this doesn't work). > > Back to the more important issue... > I put the following jobs.xml[1] file in the data folder and get [2] as > first lines of log in dba after reboot. > I put the same file into the "dbpath" folder of my app running as tomcat > webapp but the log looks like [3]. > > The feeling is that services are scheduled only in accordance to the > startup of the http server which doesn't occur when running inside Tomcat. > > In general we think that when working with tomcat one usually has to link > an external dbpath in order to avoid getting his data removed when > redeploying the webapp. The requirement to put jobs.xml inside the datapath > somehow breaks the atomicity of a deployable webapp. > A workaround could be to have the jobs.xml somehow redefined as a web.xml > variable. Might this be possible? > > Thanks for your support. > M. > > [1] > > admin:write-log('!') > admin:write-log("1=1") > > > [2] > 17:39:05.100 0:0:0:0:0:0:0:1:42740 admin 302 745.90 [GET] > http://localhost:8984/dba > 17:39:02.715 SERVER admin INFO NaN ! > 17:39:02.715 SERVER admin INFO NaN 1=1 > 17:39:02.468 SERVER admin OK NaN HTTP Server was started (port: 8984). > 17:39:02.454 SERVER admin OK NaN Server was started (port: 1984). > [3] > 17:29:04.933 0:0:0:0:0:0:0:1:52332 admin 302 1497.81 [GET] > http://localhost:8081/contract-repository/dba > 17:28:43.218 SERVER admin OK NaN Server was started (port: 1984). > > On 15/10/2018 16:59, Christian Gr?n wrote: > > Hi Marco, > > I tried to reproduce the problem: > > 1. I downloaded http://files.basex.org/releases/9.0.2/BaseX902.zip > 2. I unzipped the archive > 3. I added a jobs.xml file in the basex/data directory: > > > admin:write-log('!') > > > 4. I started basexhttp > 5. As expected, the log entry is listed in the DBA logs panel. > 6. jobs:services() returns admin:write-log('!') > > Could you do the same and report back to us what you did differently? > > Thanks in advance > Christian > > > > > > Hi Christian, > thank you as usual for your attention. > With standalone I mean basexhttp which is what we usually do. This time > we have requirement for running inside tomcat... > The jobs.xml file looks like: > > > if (db:exists('onedb')) then () else > db:create('ondedb') > > > but we have also tried with: > > > admin:write-log(current-dateTime()) > > > which presents the exact same issues: basexhttp runs ok but > jobs:services() doesn't list them whereas tomcat doesn't run the scripts > but services are listed. > Thank you again, > Marco. > > On 15/10/2018 15:25, Christian Gr?n wrote: > > Hi Marco, > > I see your question didn?t get an answer yet. Maybe we can first try > to find out what Jetty does (or does not): > > > When running standalone with Jetty, the scripts are executed even if, in > this case, we are getting empty results when running jobs:services() in > the DBA after startup. > > Some questions back: > 1. By 'standalone', do you mean that you are running 'basexhttp', or > do you run Jetty and deploy BaseX as WAR file? > 2. How does the jobs.xml file in the database directory look like? > > Cheers, > Christian > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.lettere at gmail.com Mon Oct 15 18:20:09 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Mon, 15 Oct 2018 18:20:09 +0200 Subject: [basex-talk] Tomcat & services In-Reply-To: References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> <29e646f8-1608-cab2-0740-4cf74d067a33@gmail.com> Message-ID: On 15/10/2018 17:56, Christian Gr?n wrote: > Thanks for your summary on the behavior of Tomcat. > > > In general we think that when working with tomcat one usually has to > link an external dbpath in order to avoid getting his data removed > when redeploying the webapp. The requirement to put jobs.xml inside > the datapath somehow breaks the atomicity of a deployable webapp. > > A workaround could be to have the jobs.xml somehow redefined as a > web.xml variable. Might this be possible? > > To understand your use case better: > 1. Do you currently define an external database path when working with > Tomcat? Yes. It's necessary. Otherwise, for each redeploy of the webapp, the data is lost. > 2. Would you prefer to have a servlet-specific jobs.xml file and an > external database directory, or should both of them be placed > internally or externally? I think there is nothing against how dbpath is handled now. One has just to uncomment the dbpath variable inside the web.xml of the webapps that require persistent data and change it. That's good enough for us. At the same time the unfortunate consequence is that jobs.xml, which to our feeling is something that lives with code and not with data, has to be copied manually to the external dbpath in scenarios where you redeploy a webapp after some fixes or tuning. So our suggestion is to have something like a "jobs" variable in web.xml that points to an servlet internal jobs.xml (maybe in the WEB-INF folder?) to be used instead of the default one. In any case I don't know if this solves the current misbehaviour we have with tomcat which simply and rudely ignores the content of jobs.xml altogether. I hope things are slightly clearer now. M. > > > > Just a guess, but maybe it would generally be a good idea to be able > to define an external database directory for Tomcat? Or would you > indeed like to have servlet-specific databases removod if > > > On Mon, Oct 15, 2018 at 5:47 PM Marco Lettere > wrote: > > Ok, actually on my personal PC jobs are correctly listed also with > basexhttp (need to investigate why on my colleagues PC this > doesn't work). > > Back to the more important issue... > I put the following jobs.xml[1] file in the data folder and get > [2] as first lines of log in dba after reboot. > I put the same file into the "dbpath" folder of my app running as > tomcat webapp but the log looks like [3]. > > The feeling is that services are scheduled only in accordance to > the startup of the http server which doesn't occur when running > inside Tomcat. > > In general we think that when working with tomcat one usually has > to link an external dbpath in order to avoid getting his data > removed when redeploying the webapp. The requirement to put > jobs.xml inside the datapath somehow breaks the atomicity of a > deployable webapp. > A workaround could be to have the jobs.xml somehow redefined as a > web.xml variable. Might this be possible? > > Thanks for your support. > M. > > [1] > > ? admin:write-log('!') > ? admin:write-log("1=1") > > > [2] > 17:39:05.100 0:0:0:0:0:0:0:1:42740 admin 302 745.90 [GET] > http://localhost:8984/dba > 17:39:02.715 SERVER admin INFO NaN ! > 17:39:02.715 SERVER admin INFO NaN 1=1 > 17:39:02.468 SERVER admin OK NaN HTTP Server was started > (port: 8984). > 17:39:02.454 SERVER admin OK NaN Server was started (port: > 1984). > > > [3] > 17:29:04.933 0:0:0:0:0:0:0:1:52332 admin 302 1497.81 [GET] > http://localhost:8081/contract-repository/dba > 17:28:43.218 SERVER admin OK NaN Server was started (port: > 1984). > > > > On 15/10/2018 16:59, Christian Gr?n wrote: >> Hi Marco, >> >> I tried to reproduce the problem: >> >> 1. I downloadedhttp://files.basex.org/releases/9.0.2/BaseX902.zip >> 2. I unzipped the archive >> 3. I added a jobs.xml file in the basex/data directory: >> >> >> admin:write-log('!') >> >> >> 4. I started basexhttp >> 5. As expected, the log entry is listed in the DBA logs panel. >> 6. jobs:services() returns admin:write-log('!') >> >> Could you do the same and report back to us what you did differently? >> >> Thanks in advance >> Christian >> >> >> >> >>> Hi Christian, >>> thank you as usual for your attention. >>> With standalone I mean basexhttp which is what we usually do. This time >>> we have requirement for running inside tomcat... >>> The jobs.xml file looks like: >>> >>> >>> if (db:exists('onedb')) then () else >>> db:create('ondedb') >>> >>> >>> but we have also tried with: >>> >>> >>> admin:write-log(current-dateTime()) >>> >>> >>> which presents the exact same issues: basexhttp runs ok but >>> jobs:services() doesn't list them whereas tomcat doesn't run the scripts >>> but services are listed. >>> Thank you again, >>> Marco. >>> >>> On 15/10/2018 15:25, Christian Gr?n wrote: >>>> Hi Marco, >>>> >>>> I see your question didn?t get an answer yet. Maybe we can first try >>>> to find out what Jetty does (or does not): >>>> >>>>> When running standalone with Jetty, the scripts are executed even if, in >>>>> this case, we are getting empty results when running jobs:services() in >>>>> the DBA after startup. >>>> Some questions back: >>>> 1. By 'standalone', do you mean that you are running 'basexhttp', or >>>> do you run Jetty and deploy BaseX as WAR file? >>>> 2. How does the jobs.xml file in the database directory look like? >>>> >>>> Cheers, >>>> Christian > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 15 21:52:33 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 15 Oct 2018 21:52:33 +0200 Subject: [basex-talk] Tomcat & services In-Reply-To: References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> <29e646f8-1608-cab2-0740-4cf74d067a33@gmail.com> Message-ID: > > At the same time the unfortunate consequence is that jobs.xml, which to > our feeling is something that lives with code and not with data, has to be > copied manually to the external dbpath in scenarios where you redeploy a > webapp after some fixes or tuning. So our suggestion is to have something > like a "jobs" variable in web.xml that points to an servlet internal > jobs.xml (maybe in the WEB-INF folder?) to be used instead of the default > one. > I see! We?ll keep this in mind and think about some alternatives. -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at swennenhuis.nl Tue Oct 16 14:29:27 2018 From: paul at swennenhuis.nl (Paul Swennenhuis) Date: Tue, 16 Oct 2018 14:29:27 +0200 Subject: [basex-talk] BaseX hanging for unknown reason In-Reply-To: References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> <29e646f8-1608-cab2-0740-4cf74d067a33@gmail.com> Message-ID: Hi all, I've been using BaseX for a couple of years now for a quite well visited assesment site, where the role of BaseX is to store and query the assessment results. The site functioned very well last year. This summer I upgraded to BaseX 9.2, and since then I see BaseX hanging on a request every once in a while, causing the assessment site to not respond at all anymore. In the log I see entries without further information, except 'Digest authentication expected', and with fast increasing response times, see attached picture. I know this is very little information, but does anyone have an idea what might be causing this? And what to do about those 'Digest authentication expected' messages? I DID configure BaseX for Digest authentication, and as far as I know I am using it for every request. Paul -------------- next part -------------- A non-text attachment was scrubbed... Name: basexfail.png Type: image/png Size: 112977 bytes Desc: not available URL: From christian.gruen at gmail.com Tue Oct 16 15:47:13 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Tue, 16 Oct 2018 15:47:13 +0200 Subject: [basex-talk] BaseX hanging for unknown reason In-Reply-To: References: <16008496-61cc-4766-2dca-3e5688b31ddd@gmail.com> <63514622-e4af-7730-3fcd-a14af7ce5a1d@gmail.com> <29e646f8-1608-cab2-0740-4cf74d067a33@gmail.com> Message-ID: Hi Paul, . This summer I upgraded to BaseX > 9.2, and since then I see BaseX hanging on a request every once in a > while, causing the assessment site to not respond at all anymore. > So this means that some of your request with digest authentication work, and others don?t? In the log I see entries without further information, except 'Digest > authentication expected', and with fast increasing response times, see > attached picture. > Could you give us more information how your requests look like? Are they all sent from the browser, or from any other system? And what to do about those 'Digest authentication expected' messages? I > DID configure BaseX for Digest authentication, and as far as I know I am > using it for every request. Do you have more details on the requests that cause this error message? Cheers Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.rauchenwald at unifits.com Wed Oct 17 09:52:57 2018 From: tom.rauchenwald at unifits.com (Tom Rauchenwald (UNIFITS)) Date: Wed, 17 Oct 2018 07:52:57 +0000 Subject: [basex-talk] Reflect.forName() / Performance Message-ID: Hi BaseX-Team, when profiling some of our tests i found that we spend some time in Reflect.forName(). We have 2 xquery modules in the repo (we don't call java code directly). I'm not sure why BaseX tries to load our xqm as Java Modules, but what I noticed is that Reflect.forName caches the positive case (i.e., the class is found), but not the negative case (i.e., the class is not found). I've changed the code to cache the negative case as well (see below), and noticed an improvement of about 5 percent. Our tests create and query loads of small databases, so this is maybe quite an artificial speedup. I could provide a PR if this is a worthwhile improvement in your opinion (and if I'm not missing something obvious). We're still on BaseX 8.7.6 in case that matters, as far as I could see the Code didn't change in BaseX 9. Thanks, Tom Code: public static Class forName(final String name) throws ClassNotFoundException { Class c = CLASSES.get(name); if(c == null) { if (CLASSES.containsKey(name)) { throw new ClassNotFoundException(name); } else { try { c = Class.forName(name); } catch (ClassNotFoundException e) { CLASSES.put(name, null); throw e; } if (!Modifier.isPublic(c.getModifiers())) throw new ClassNotFoundException(name); CLASSES.put(name, c); } } return c; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Wed Oct 17 12:12:01 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Wed, 17 Oct 2018 12:12:01 +0200 Subject: [basex-talk] Reflect.forName() / Performance In-Reply-To: References: Message-ID: Hi Tom, Thanks for your observation and your code proposal; always welcome. I have some concerns that the caching of non-existing classes could be exploited and bloat the cache. Maybe we?d need to use WeakHashMap (and/or soft references) instead? > I'm not sure why BaseX tries to load our xqm as Java Modules, but what I noticed is that Reflect.forName caches the positive case (i.e., the class is found), but not the negative case (i.e., the class is not found). Sounds like an interesting finding; maybe there?s something we can optimize here. Could you possibly provide us a little self-contained example that demonstrates the behavior? Thanks in advance, Christian On Wed, Oct 17, 2018 at 9:53 AM Tom Rauchenwald (UNIFITS) wrote: > > Hi BaseX-Team, > > > when profiling some of our tests i found that we spend some time in Reflect.forName(). > > We have 2 xquery modules in the repo (we don't call java code directly). > > > I'm not sure why BaseX tries to load our xqm as Java Modules, but what I noticed is that Reflect.forName caches the positive case (i.e., the class is found), but not the negative case (i.e., the class is not found). > > I've changed the code to cache the negative case as well (see below), and noticed an improvement of about 5 percent. > > Our tests create and query loads of small databases, so this is maybe quite an artificial speedup. > > > I could provide a PR if this is a worthwhile improvement in your opinion (and if I'm not missing something obvious). > > > We're still on BaseX 8.7.6 in case that matters, as far as I could see the Code didn't change in BaseX 9. > > > Thanks, > > Tom > > > Code: > > > public static Class forName(final String name) throws ClassNotFoundException { > Class c = CLASSES.get(name); > > if(c == null) { > if (CLASSES.containsKey(name)) { > throw new ClassNotFoundException(name); > } else { > try { > c = Class.forName(name); > } catch (ClassNotFoundException e) { > CLASSES.put(name, null); > throw e; > } > if (!Modifier.isPublic(c.getModifiers())) throw new ClassNotFoundException(name); > CLASSES.put(name, c); > } > } > return c; > } > From tom.rauchenwald at unifits.com Wed Oct 17 14:04:59 2018 From: tom.rauchenwald at unifits.com (Tom Rauchenwald) Date: Wed, 17 Oct 2018 14:04:59 +0200 Subject: [basex-talk] Reflect.forName() / Performance References: Message-ID: <87h8hk93tg.fsf@rocket.unifits.intern> Hi Christian, thanks for your feedback, I hope you're doing well! > I have some concerns that the caching of non-existing classes could be > exploited and bloat the cache. Maybe we?d need to use WeakHashMap > (and/or soft references) instead? I didn't think about that, I'll try to come up with a better solution. >> I'm not sure why BaseX tries to load our xqm as Java Modules, but >> what I noticed is that Reflect.forName caches the positive case >> (i.e., the class is found), but not the negative case (i.e., the class is not found). > > Sounds like an interesting finding; maybe there?s something we can > optimize here. Could you possibly provide us a little self-contained > example that demonstrates the behavior? Sure. This is what I'm doing: Given the following module (installed with module install foo.xqm): module namespace uc = 'http://unifits.com/common'; declare function uc:remove-elements($input as element(), $remove-names as xs:string*) as element() { element {node-name($input) } {$input/@*, for $child in $input/node()[not(local-name() = $remove-names)] return if ($child instance of element()) then uc:remove-elements($child, $remove-names) else $child } }; if I start BaseXGui in debug mode, and set a breakpoint in Reflect.forName(), every time I execute a query such as import module namespace uc = 'http://unifits.com/common'; / the breakpoint is hit, i.e. Class.forName() is called. I *think* this might have to do with the fact that the function above is recursive, but I have to admit that I don't really grasp the code that does the module loading/parsing. Thanks, -tom From christian.gruen at gmail.com Wed Oct 17 23:16:04 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Wed, 17 Oct 2018 23:16:04 +0200 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: Hi Radu, Do you think the DITA parsing should work if dita-ng.jar is placed first in the classpath? Cheers, Christian Jason Davis schrieb am Mo., 15. Okt. 2018, 17:46: > Hi Christian, Radu, > > I?ve tried adding the dita-ng.jar to the lib/custom dir of basex and then > manually modified the startup script to load it first. I can even confirm > that it?s the first jar on the path using: > > proc:property('java.class.path') > > However, the database still fails to parse the XML with default attributes > applied. I find myself having to cobble together an undesirable workaround > whereby I manually supply the default attribute values myself in order to > get my project to work with BaseX. Do you have any further suggestions for > how I might get this to work? > > Thanks, > Jason > > ?On 10/3/18, 3:24 AM, "Christian Gr?n" wrote: > > Hi Jason (cc to the list), > > > I set the CP variable like so: > > > CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH > > > > This appears to be slightly different than the example you linked > Christian. I?m using BaseX 9.0.2. Does this make a difference? > > The start scripts in the official distributions are created from the > GitHub examples I linked, so they are slightly different. > > > I added an echo $CLASSPATH line under the CP variable. When I run > the script, the echo statement is blank. > > In the script, no value will be bound to the $CLASSPATH variable. > Instead, you can assign values to this variable by yourself, which > will then be appended to the $CP variable. If you didn?t do so, and if > your Linux environment does not have any other values assigned to this > variable (which is the default), the output will necessarily be empty. > > > Is there a way to see how the classpath is set when running this > script? > > To answer the "how": It will be set via the line that you will find > some lines below in the script, and the -cp Java argument: > > exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@" > > If you want to know which value is bound to $CP, try "echo $CP". In > Java, the full user class path at runtime will be bound to the > "java.class.path" system property. It can e.g. be retrieved via > proc:property('java.class.path') [1]. > > Christian > > [1] http://docs.basex.org/wiki/Process_Module#proc:property > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mgaerber at arcor.de Thu Oct 18 18:04:47 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Thu, 18 Oct 2018 18:04:47 +0200 Subject: [basex-talk] Sir, when basex 9.1, please ;-) Message-ID: From christian.gruen at gmail.com Thu Oct 18 18:33:57 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Thu, 18 Oct 2018 18:33:57 +0200 Subject: [basex-talk] Sir, when basex 9.1, please ;-) In-Reply-To: References: Message-ID: Sir, doing our best ;) We believe that BaseX 9.1 pretty soon (until end of October). For everyone who is interested in giving us some feedback on the new WebSocket feature? Thank you in advance! 90% of the documentation is finalized: http://docs.basex.org/wiki/WebSockets Best, Christian From radu_coravu at sync.ro Fri Oct 19 15:00:17 2018 From: radu_coravu at sync.ro (Radu Coravu) Date: Fri, 19 Oct 2018 16:00:17 +0300 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: Hi Christian, Sorry for the delay, I installed a BaseX server on my side just to test things out but I have not used BaseX before. So: - I created a new database. - Added an XML document to the database, the XML document containing a reference to the RNG schema. - Add an extra XML catalog to the BaseX configuration. In the ".basex" config file I added: > CATFILE=file:/D:/projects/eXml/frameworks/dita/DITA-OT2.x/catalog-dita.xml Did I correctly add the reference to the XML catalog or should it be a file-like path instead? For example if I - Added the "dita-ng.jar" to the "lib/custom" folder. I thought things out and the "dita-ng.jar" does not need to be added with high priority in the class path, just adding it there should be enough. - Create a new XQuery which loads the XML document and tries to list the root element (in order to see if the default attributes are loaded or not). - Run the XQuery and I can do that as well as I installed an add-on for Oxygen XML Editor which allows me to run an XQuery: http://argon-author.com/ After running the XQuery the returned XML content does not contain the default attributes expanded. So it does not work. I will try to find more time to add some System.err's in the Java code of the "dita-ng.jar" and re-pack it, restart the server. Will I find that extra logging in the console I used to start "basexhttp.bat"? Or do I need to first configure the logging? Regards, Radu Radu Coravu XML Editor http://www.oxygenxml.com On 10/18/2018 12:16 AM, Christian Gr?n wrote: > Hi Radu, > > Do you think the DITA parsing should work if dita-ng.jar is placed first > in the classpath? > > Cheers, > Christian > > > > > Jason Davis > schrieb am Mo., 15. Okt. 2018, 17:46: > > Hi Christian, Radu, > > I?ve tried adding the dita-ng.jar to the lib/custom dir of basex and > then manually modified the startup script to load it first. I can > even confirm that it?s the first jar on the path using: > > proc:property('java.class.path') > > However, the database still fails to parse the XML with default > attributes applied. I find myself having to cobble together an > undesirable workaround whereby I manually supply the default > attribute values myself in order to get my project to work with > BaseX. Do you have any further suggestions for how I might get this > to work? > > Thanks, > Jason > > ?On 10/3/18, 3:24 AM, "Christian Gr?n" > wrote: > > Hi Jason (cc to the list), > > > I set the CP variable like so: > > > CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH > > > > This appears to be slightly different than the example you > linked Christian. I?m using BaseX 9.0.2. Does this make a difference? > > The start scripts in the official distributions are created from the > GitHub examples I linked, so they are slightly different. > > > I added an echo $CLASSPATH line under the CP variable. When I > run the script, the echo statement is blank. > > In the script, no value will be bound to the $CLASSPATH variable. > Instead, you can assign values to this variable by yourself, which > will then be appended to the $CP variable. If you didn?t do so, > and if > your Linux environment does not have any other values assigned > to this > variable (which is the default), the output will necessarily be > empty. > > > Is there a way to see how the classpath is set when running > this script? > > To answer the "how": It will be set via the line that you will find > some lines below in the script, and the -cp Java argument: > > exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@" > > If you want to know which value is bound to $CP, try "echo $CP". In > Java, the full user class path at runtime will be bound to the > "java.class.path" system property. It can e.g. be retrieved via > proc:property('java.class.path') [1]. > > Christian > > [1] http://docs.basex.org/wiki/Process_Module#proc:property > > > From christian.gruen at gmail.com Fri Oct 19 18:26:24 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Fri, 19 Oct 2018 18:26:24 +0200 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: Hi Radu, Thanks for trying to get this working. > - I created a new database. > - Added an XML document to the database, the XML document containing a > reference to the RNG schema. Just a guess: You may need to supply the catalog before adding the document to the database. In the GUI, if you open the Database ? New? dialog, you can specify the file via the parser dialog. Adding the path in the .basex file should work as well (it doesn?t matter if you specify a local file path or a file:// URI). > Will I find that extra logging in the console I used to start > "basexhttp.bat"? Or do I need to first configure the logging? If you start basex instances with the -d flag, you?ll get some more feedback. Hope this helps, further questions are welcome, Christian From christian.gruen at gmail.com Fri Oct 19 18:40:32 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Fri, 19 Oct 2018 18:40:32 +0200 Subject: [basex-talk] Reflect.forName() / Performance In-Reply-To: <87h8hk93tg.fsf@rocket.unifits.intern> References: <87h8hk93tg.fsf@rocket.unifits.intern> Message-ID: Hi Tom, Thanks for the XQuery example. Your hint was helpful: If a function signature is not registered yet when it is parsed, all kind of lookups are performed to locate the function. This is e.g. the case if the function is recursive, or if the invoked functions occurs after the currently parsed code. I have revised the code which is responsible for locating invoked functions: In the JavaFunction class [1], the lookup will be avoided if we can tell in advance that no Java class will be found. A new snapshot is online [2]; looking forward to your profiling results, Christian [1] https://github.com/BaseXdb/basex/commit/878c70fa3e1ef8ec6ab1f08b31f83e3157fc04c0#diff-2593cd6d13416ce7a77f1fba8f42a177R197 [2] http://files.basex.org/releases/latest/ > Given the following module (installed with module install foo.xqm): > > module namespace uc = 'http://unifits.com/common'; > declare function uc:remove-elements($input as element(), $remove-names as xs:string*) as element() { > element {node-name($input) } > {$input/@*, > for $child in $input/node()[not(local-name() = $remove-names)] > return > if ($child instance of element()) > then uc:remove-elements($child, $remove-names) > else $child > } > }; > > > if I start BaseXGui in debug mode, and set a breakpoint in > Reflect.forName(), every time I execute a query such as > > import module namespace uc = 'http://unifits.com/common'; > / > > the breakpoint is hit, i.e. Class.forName() is called. > I *think* this might have to do with the fact that the function above is > recursive, but I have to admit that I don't really grasp the code that > does the module loading/parsing. > > Thanks, > -tom From jason.davis at hortonworks.com Fri Oct 19 23:01:43 2018 From: jason.davis at hortonworks.com (Jason Davis) Date: Fri, 19 Oct 2018 21:01:43 +0000 Subject: [basex-talk] Optimized query for importing content based on metadata Message-ID: <58032018-F8E1-47D1-9F10-FEDF8F9C002F@hortonworks.com> Hi, I?ve cobbled together a query that I want to use to import xml from the filesystem into the database based on specific metadata requirements: let $xmlroot := "/Users/jason.davis/Sandbox/dita-docs/content/" for $file in file:list($xmlroot, true()) where matches($file, 'xml') or matches($file, 'ditamap') let $doc := file:resolve-path($file, $xmlroot) return if (doc($doc)//brand[contains(.,'xyz')]) then db:add("d4st^dita-docs^meta-test", $doc) else () It works, so I?m pleased! I?m just wondering if there is a more efficient way to achieve what I want to do. I know that using a specific XPath in the doc function is one thing I can do better. Any suggestions are appreciated! Thanks, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Fri Oct 19 23:26:16 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Fri, 19 Oct 2018 23:26:16 +0200 Subject: [basex-talk] Optimized query for importing content based on metadata In-Reply-To: <58032018-F8E1-47D1-9F10-FEDF8F9C002F@hortonworks.com> References: <58032018-F8E1-47D1-9F10-FEDF8F9C002F@hortonworks.com> Message-ID: Hi Jason, My version would have looked pretty similar: let $xmlroot := '/Users/jason.davis/Sandbox/dita-docs/content/' for $path in file:list($xmlroot, true()) where matches($path, '\.(xml|ditamap)$') let $doc := doc($xmlroot || $path) where $doc//brand[contains(., 'xyz')] return db:add('d4st^dita-docs^meta-test', $doc, $path) If you have already openen the document, you can directly pass it on to db:add. Cheers, Christian On Fri, Oct 19, 2018 at 11:01 PM Jason Davis wrote: > > Hi, > > I?ve cobbled together a query that I want to use to import xml from the filesystem into the database based on specific metadata requirements: > > let $xmlroot := "/Users/jason.davis/Sandbox/dita-docs/content/" > for $file in file:list($xmlroot, true()) > where matches($file, 'xml') or matches($file, 'ditamap') > let $doc := file:resolve-path($file, $xmlroot) > return if (doc($doc)//brand[contains(.,'xyz')]) > then db:add("d4st^dita-docs^meta-test", $doc) > else () > > It works, so I?m pleased! I?m just wondering if there is a more efficient way to achieve what I want to do. I know that using a specific XPath in the doc function is one thing I can do better. Any suggestions are appreciated! > > Thanks, > Jason From manzikki at gmail.com Mon Oct 22 04:40:20 2018 From: manzikki at gmail.com (Marko Niinimaki) Date: Mon, 22 Oct 2018 09:40:20 +0700 Subject: [basex-talk] Bug/question: large collection Message-ID: Hi, it looks like "nodes" exceeds some integer range if I add 2 million documents (below). Another, unrelated question: our server has 24 cores. What would be the best way to utilize that kind of parallel power in queries? > info db Database Properties NAME: tmp SIZE: 47 GB NODES: -2147476286 DOCUMENTS: 705708 BINARIES: 0 TIMESTAMP: 2018-08-29T02:27:58.000Z UPTODATE: false Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 9.0.2 Java: Oracle Corporation, 1.8.0_66 OS: Linux, amd64 Stack Trace: java.lang.ArrayIndexOutOfBoundsException -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter.zanzinger at icloud.com Mon Oct 22 06:33:19 2018 From: dieter.zanzinger at icloud.com (Dieter Zanzinger) Date: Mon, 22 Oct 2018 06:33:19 +0200 Subject: [basex-talk] Websocket Vers. 9.1 on Tomcat Message-ID: <0437F7D1-B93E-411F-9F21-17E2C0EA2F6F@icloud.com> Hi, BaseX-Team, I tested the new websocket-feature. The .zip- installation on Win10 (your embedded jetty) worked (your chat-app). But I had problems with the .war -installation on tomcat. With the standard-installation, the paths in the chat.js had to be preceded with /BaseX - ok so far. I get the login-page and main-page visible - ok. But when the main-page is loading, the network call to http://localhost:8080/BaseX/ws/chat fails with http-code 404. I think, there is a problem with paths as well? It would be great, if you could add documentation for Tomcat as well. Thanks for this great tool! Dieter Zanzinger -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 22 10:40:28 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 22 Oct 2018 10:40:28 +0200 Subject: [basex-talk] Bug/question: large collection In-Reply-To: References: Message-ID: Hi Marko, Databases are restricted to 2^31 nodes. If the limit is exceeded, you?ll need to distribute your documents across multiple database instances (see [1] for more details). However, I would have expected BaseX to raise an error message. Could you give us more detail how you imported the documents? By default, 8 parallel queries are allowed. The number can be changed by assigning a different value to the PARALLEL option [2]. In most cases, you?ll get best results if you ensure that your queries are rewritten for index access (provided that your queries allows such rewritings), as multiple concurrent databases access may have negative effects, in particular if sequential scans are required. Obviously, things looks slightly better for SSDs. Hope this helps, Christian [1] http://docs.basex.org/wiki/Databases [2] http://docs.basex.org/wiki/Options#PARALLEL On Mon, Oct 22, 2018 at 4:40 AM Marko Niinimaki wrote: > > Hi, > it looks like "nodes" exceeds some integer range if I add 2 million documents (below). > > Another, unrelated question: our server has 24 cores. What would be the best way to utilize that kind of parallel power in queries? > > > info db > Database Properties > NAME: tmp > SIZE: 47 GB > NODES: -2147476286 > DOCUMENTS: 705708 > BINARIES: 0 > TIMESTAMP: 2018-08-29T02:27:58.000Z > UPTODATE: false > > > Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 9.0.2 > Java: Oracle Corporation, 1.8.0_66 > OS: Linux, amd64 > Stack Trace: > java.lang.ArrayIndexOutOfBoundsException > From kracht-berlin at hotmail.de Mon Oct 22 10:48:55 2018 From: kracht-berlin at hotmail.de (Jennifer Kracht) Date: Mon, 22 Oct 2018 08:48:55 +0000 Subject: [basex-talk] Missing two things but great tool! Message-ID: Hi, thank you for this handy and comprehensive tool! I have tested other ?non-open source? but they are not working so smart like this. When I started working with XML files I had problems to find the relevant information. But this tool helped me a lot to figure out the general structure. There are just two things that I?m missing and wanted to ask if this is planned for future: 1. I really like the map visualisation possibility. I use lot of XML with coordinates and I was impressed that the tool could figure out them automatically. But it would be much more cooler to see it with a real map in background. 2. I tried to export the XML to CSV but this seems not working. The exported file is not usable. In past I just used Excel and it?s source task pane to bring it into a table format (filtering and sorting) so an export to Excel woud be cool! I understand that it?s an open source application but maybe you have possibilities to do something for it. Best Regards Jennifer From manzikki at gmail.com Mon Oct 22 11:14:57 2018 From: manzikki at gmail.com (Marko Niinimaki) Date: Mon, 22 Oct 2018 16:14:57 +0700 Subject: [basex-talk] Bug/question: large collection In-Reply-To: References: Message-ID: Hi Christian, many thanks! > However, I would have expected BaseX to raise an error message. Could you give us more detail how you imported the documents? Yes it did. I had a file with about 1 million add filename statements and when the max nodes limit was exceeded, each statement gave an error message. Best regards, Marko On Mon, Oct 22, 2018 at 3:40 PM Christian Gr?n wrote: > Hi Marko, > > Databases are restricted to 2^31 nodes. If the limit is exceeded, > you?ll need to distribute your documents across multiple database > instances (see [1] for more details). > > However, I would have expected BaseX to raise an error message. Could > you give us more detail how you imported the documents? > > By default, 8 parallel queries are allowed. The number can be changed > by assigning a different value to the PARALLEL option [2]. In most > cases, you?ll get best results if you ensure that your queries are > rewritten for index access (provided that your queries allows such > rewritings), as multiple concurrent databases access may have negative > effects, in particular if sequential scans are required. Obviously, > things looks slightly better for SSDs. > > Hope this helps, > Christian > > [1] http://docs.basex.org/wiki/Databases > [2] http://docs.basex.org/wiki/Options#PARALLEL > > > > On Mon, Oct 22, 2018 at 4:40 AM Marko Niinimaki > wrote: > > > > Hi, > > it looks like "nodes" exceeds some integer range if I add 2 million > documents (below). > > > > Another, unrelated question: our server has 24 cores. What would be the > best way to utilize that kind of parallel power in queries? > > > > > info db > > Database Properties > > NAME: tmp > > SIZE: 47 GB > > NODES: -2147476286 > > DOCUMENTS: 705708 > > BINARIES: 0 > > TIMESTAMP: 2018-08-29T02:27:58.000Z > > UPTODATE: false > > > > > > Improper use? Potential bug? Your feedback is welcome: > > Contact: basex-talk at mailman.uni-konstanz.de > > Version: BaseX 9.0.2 > > Java: Oracle Corporation, 1.8.0_66 > > OS: Linux, amd64 > > Stack Trace: > > java.lang.ArrayIndexOutOfBoundsException > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 22 11:18:39 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 22 Oct 2018 11:18:39 +0200 Subject: [basex-talk] Missing two things but great tool! In-Reply-To: References: Message-ID: Hi Jennifer, Welcome to the list, and thanks for the kudos. > 1. I really like the map visualisation possibility. I use lot of XML with coordinates and I was impressed that the tool could figure out them automatically. But it would be much more cooler to see it with a real map in background. We thought about adding a feature to choose background images in the scatterplot. If you have two-dimensional latitude/longitude data, single data set could then be assigned visually to geographic locations. I am not sure how that could look like for our map visualization? Could you give us more details? You may have discovered our set of map layouts in the GUI preferences, but probably they don?t match your specific requirements. > 2. I tried to export the XML to CSV but this seems not working. As XML resources may be arbitrarily nested, there is no canonical way of exporting them to a tabular representation. The CSV module [1] gives you all flexibility to create tabular exports exactly as you want them to be, but you?ll need to write some XQuery code for that. Hope this helps, Christian [1] http://docs.basex.org/wiki/CSV_Module From christian.gruen at gmail.com Mon Oct 22 11:20:43 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 22 Oct 2018 11:20:43 +0200 Subject: [basex-talk] Bug/question: large collection In-Reply-To: References: Message-ID: > Yes it did. I had a file with about 1 million add filename statements and when the max nodes limit was exceeded, each statement gave an error message. Was this a ?command script? [1], and did you call the ADD command or the db:add function? Thanks in advance, Christian [1] http://docs.basex.org/wiki/Commands#Command_Scripts From manzikki at gmail.com Mon Oct 22 11:23:41 2018 From: manzikki at gmail.com (Marko Niinimaki) Date: Mon, 22 Oct 2018 16:23:41 +0700 Subject: [basex-talk] Bug/question: large collection In-Reply-To: References: Message-ID: Yes, a command script: open mydb add file1.xml add file2.xml etc Best regards, Marko On Mon, Oct 22, 2018 at 4:21 PM Christian Gr?n wrote: > > Yes it did. I had a file with about 1 million add filename statements > and when the max nodes limit was exceeded, each statement gave an error > message. > > Was this a ?command script? [1], and did you call the ADD command or > the db:add function? > > Thanks in advance, > Christian > > [1] http://docs.basex.org/wiki/Commands#Command_Scripts > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 22 12:31:19 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 22 Oct 2018 12:31:19 +0200 Subject: [basex-talk] Websocket Vers. 9.1 on Tomcat In-Reply-To: <0437F7D1-B93E-411F-9F21-17E2C0EA2F6F@icloud.com> References: <0437F7D1-B93E-411F-9F21-17E2C0EA2F6F@icloud.com> Message-ID: Hi Dieter, The current WebSocket implementation is based on Jetty?s WebSocket API. This was clearly missing in the documentation (thanks for the pointer), so I have just updated our Wiki pages [1]. It appears that Jetty?s implementation of the official JSR-356 WebSocket API is pretty stable nowadays. As it?s quite similar to their custom API (which served as inspiration for the generic API), we might switch to the new version in future versions of BaseX. All the best, Christian [1] http://docs.basex.org/wiki/WebSockets On Mon, Oct 22, 2018 at 6:34 AM Dieter Zanzinger wrote: > > Hi, BaseX-Team, > > I tested the new websocket-feature. > The .zip- installation on Win10 (your embedded jetty) worked (your chat-app). > But I had problems with the .war -installation on tomcat. With the standard-installation, the paths in the chat.js had to be preceded with /BaseX - ok so far. I get the login-page and main-page visible - ok. But when the main-page is loading, the network call to http://localhost:8080/BaseX/ws/chat fails with http-code 404. > I think, there is a problem with paths as well? > > It would be great, if you could add documentation for Tomcat as well. > > Thanks for this great tool! > > Dieter Zanzinger From m.lettere at gmail.com Mon Oct 22 13:21:13 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Mon, 22 Oct 2018 13:21:13 +0200 Subject: [basex-talk] Sir, when basex 9.1, please ;-) In-Reply-To: References: Message-ID: Hi, I'm just hijacking Maximilian's email here to post the following test I wanted to do for experimenting with BaseX and Websockets. I wrote the code at [1] with the intent to open a RESTXQ entrypoint that receives a JSON via POST and the broadcastst it to all connecte WS clients. I might be using ws:broadcast or the naive version as shown but still I get the following error [2] as return to my HTTP POST and, ca va sans dire, nothing on the websocket. What am I doing wrong? BTW, even if not stated in the path annotation, an extra /ws needs to be prefixed to the url used for JS' WebSocket constructor. Personally I'd prefer to keep things explicit and put it in the annotation too. Thanks for your support and thanks Maximilian for the lift. [1] module namespace dp = 'urn:nubisware:datarouter'; import module namespace ws = 'http://basex.org/modules/ws'; declare ? %rest:path('/dataprovider') ? %rest:POST("{$data}") ? %output:method('json') function dp:route($data as node()) { ? ws:send(json:serialize($data), ws:ids()[. != ws:id()]) }; declare ? %ws:connect('/dataprovider') function dp:connect() as empty-sequence() { ? () }; declare ? %ws:close('/dataprovider') function dp:close() as empty-sequence() { ? () }; [2] Stopped at /home/lettere/tmp/basex/webapp/dataprovider/dataprovider.xqm, 11/53: [basex:ws] WebSocket connection required. On 18/10/18 18:33, Christian Gr?n wrote: > Sir, doing our best ;) > > We believe that BaseX 9.1 pretty soon (until end of October). > > For everyone who is interested in giving us some feedback on the new > WebSocket feature? Thank you in advance! 90% of the documentation is > finalized: > > http://docs.basex.org/wiki/WebSockets > > Best, > Christian From christian.gruen at gmail.com Mon Oct 22 13:36:36 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 22 Oct 2018 13:36:36 +0200 Subject: [basex-talk] Sir, when basex 9.1, please ;-) In-Reply-To: References: Message-ID: Hi Marco, I?m glad to you are gathering some experience with the WebSocket facility. > I get the following error [2] as return to my HTTP POST and, ca va sans > dire, nothing on the websocket. The function bound to the "/dataprovider" is a simple RESTXQ function. As such, it isn?t attached to a WebSocket id. One of the reasons is that a client who?s using RESTXQ may not necessarily have a WebSocket connection, or there can also be multiple WebSockets per client. If you want to send your result to all WebSockets ? including the client that called the dataprovider ? you can simply use ws:emit(). If your use case is complex enough to have a WebSocket connection and simultaneous RESTXQ requests in a single browser tab, you could store the WebSocket id(s) of your client as HTTP Session attribute, and access these ids from the RESTXQ code. > BTW, even if not stated in the path annotation, an extra /ws needs to be > prefixed to the url used for JS' WebSocket constructor. Personally I'd > prefer to keep things explicit and put it in the annotation too. I have just revised our documentation, and I hope it?s fairly complete now. In the Annotations Section, you will find a hint to the "ws/" path. The reason why the path is omitted in XQuery is that the web server takes care of the path resolution. If the default path is changed in the web.xml file, it would need to be changed in all XQuery applications as well. The same applies to RESTXQ: If a prefix is used in the configuration, there won?t be a need to change your path annotations. Hope this helps, Christian [1] http://docs.basex.org/wiki/WebSockets > > Thanks for your support and thanks Maximilian for the lift. > > [1] > module namespace dp = 'urn:nubisware:datarouter'; > > import module namespace ws = 'http://basex.org/modules/ws'; > > declare > %rest:path('/dataprovider') > %rest:POST("{$data}") > %output:method('json') > function dp:route($data as node()) { > ws:send(json:serialize($data), ws:ids()[. != ws:id()]) > }; > > declare > %ws:connect('/dataprovider') > function dp:connect() as empty-sequence() { > () > }; > > declare > %ws:close('/dataprovider') > function dp:close() as empty-sequence() { > () > }; > > [2] > Stopped at /home/lettere/tmp/basex/webapp/dataprovider/dataprovider.xqm, > 11/53: > [basex:ws] WebSocket connection required. > > On 18/10/18 18:33, Christian Gr?n wrote: > > Sir, doing our best ;) > > > > We believe that BaseX 9.1 pretty soon (until end of October). > > > > For everyone who is interested in giving us some feedback on the new > > WebSocket feature? Thank you in advance! 90% of the documentation is > > finalized: > > > > http://docs.basex.org/wiki/WebSockets > > > > Best, > > Christian > > From mgaerber at arcor.de Mon Oct 22 13:46:35 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Mon, 22 Oct 2018 13:46:35 +0200 Subject: [basex-talk] Fairlock and query monitoring Message-ID: Hi, for some time now, I've switched a production system (running Basex 8.6) to FAIRLOCK = true. With PARALLEL = 16. While this helped speed up write operations, there are situations where queries go from sub-second to minute(s) if a few more users are reading/writing at the same time. The DBs in question are incrementally indexed. Since single queries are fast, I don't know what the best way of handling these situations would be. As a last resort I was thinking about adding a cache solution (write-behind) that allows for saving and delays (batches) writes. But before introducing another component to the system, I'd like to hear what other ideas might exist. Br, Max From jason.davis at hortonworks.com Mon Oct 22 16:53:08 2018 From: jason.davis at hortonworks.com (Jason Davis) Date: Mon, 22 Oct 2018 14:53:08 +0000 Subject: [basex-talk] Optimized query for importing content based on metadata In-Reply-To: References: <58032018-F8E1-47D1-9F10-FEDF8F9C002F@hortonworks.com> Message-ID: <8A4B13E9-F214-41D1-ADE6-4E8205F5CF90@hortonworks.com> Thanks Christian! I appreciate the touch-up and the insight. Jason ?On 10/19/18, 2:26 PM, "Christian Gr?n" wrote: Hi Jason, My version would have looked pretty similar: let $xmlroot := '/Users/jason.davis/Sandbox/dita-docs/content/' for $path in file:list($xmlroot, true()) where matches($path, '\.(xml|ditamap)$') let $doc := doc($xmlroot || $path) where $doc//brand[contains(., 'xyz')] return db:add('d4st^dita-docs^meta-test', $doc, $path) If you have already openen the document, you can directly pass it on to db:add. Cheers, Christian On Fri, Oct 19, 2018 at 11:01 PM Jason Davis wrote: > > Hi, > > I?ve cobbled together a query that I want to use to import xml from the filesystem into the database based on specific metadata requirements: > > let $xmlroot := "/Users/jason.davis/Sandbox/dita-docs/content/" > for $file in file:list($xmlroot, true()) > where matches($file, 'xml') or matches($file, 'ditamap') > let $doc := file:resolve-path($file, $xmlroot) > return if (doc($doc)//brand[contains(.,'xyz')]) > then db:add("d4st^dita-docs^meta-test", $doc) > else () > > It works, so I?m pleased! I?m just wondering if there is a more efficient way to achieve what I want to do. I know that using a specific XPath in the doc function is one thing I can do better. Any suggestions are appreciated! > > Thanks, > Jason From christian.gruen at gmail.com Mon Oct 22 18:06:11 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 22 Oct 2018 18:06:11 +0200 Subject: [basex-talk] Fairlock and query monitoring In-Reply-To: References: Message-ID: Hi Max, Are read-only queries similarly slow if FAIRLOCK is set to false? If yes, it might help to optimize the incremental database in regular time intervals. If you do that anyway, we could set up a little telko and discuss further possibilities. Cheers Christian On Mon, Oct 22, 2018 at 1:46 PM Maximilian G?rber wrote: > > Hi, > for some time now, I've switched a production system (running Basex > 8.6) to FAIRLOCK = true. With PARALLEL = 16. > > While this helped speed up write operations, there are situations > where queries go from sub-second to minute(s) if a few more users are > reading/writing at the same time. > > The DBs in question are incrementally indexed. > > Since single queries are fast, I don't know what the best way of > handling these situations would be. > > As a last resort I was thinking about adding a cache solution > (write-behind) that allows for saving and delays (batches) writes. > > But before introducing another component to the system, I'd like to > hear what other ideas might exist. > > > Br, > Max From radim-havlicek at post.cz Tue Oct 23 09:34:57 2018 From: radim-havlicek at post.cz (radim-havlicek at post.cz) Date: Tue, 23 Oct 2018 09:34:57 +0200 (CEST) Subject: [basex-talk] REQUEST REPLACE error Message-ID: Hello, we have currently 9 databases in our BaseX database. The biggest ones have about 9 GB, all together they have nearly 26 GB. Everything had worked fine until Friday. Since Friday, every time we sent REQUEST REPLACE command to any of those databases, it generated following error: 00:00:17.672 0.0.0.1:64492 admin REQUEST REPLACE Report\8f6a4b73-5be2-4246-b 0ad-3baaec0fbd54 [...] 4.16 ms 00:00:18.282 0.0.0.1:64492 admin ERROR Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 8.6.3 Java: Oracle Corporation, 1.8.0_171 OS: Windows Server 2012 R2, amd64 Stack Trace: java.lang.ArrayIndexOutOfBoundsException at org.basex.io. random.TableDiskAccess.insert(TableDiskAccess.java:347) at org.basex.data. Data.insert(Data.java:912) at org.basex.data.Data.insert(Data.java:739) at org.basex.query.up.atomic.Insert.apply(Insert.java:44) at org.basex.query. up.atomic.AtomicUpdateCache.applyUpdates(AtomicUpdateCache.java:297) at org. basex.query.up.atomic.AtomicUpdateCache.execute(AtomicUpdateCache.java:281) at org.basex.core.cmd.Replace.replace(Replace.java:104) at org.basex.core. cmd.Replace.access$0(Replace.java:69) at org.basex.core.cmd.Replace$1.run (Replace.java:57) at org.basex.core.cmd.ACreate.update(ACreate.java:90) at org.basex.core.cmd.Replace.run(Replace.java:54) at org.basex.core.Command. run(Command.java:257) at org.basex.core.Command.execute(Command.ja... 612.41 ms (It is from the log file.) We currently use BaseX version 8.6.3 Any idea why the error is generated and what could be the source of the problem? (Too big database? Too big databases all together? Some database lock?) Thank you in advance for your answer. Best Regards, Radim Havlicek -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.rauchenwald at unifits.com Tue Oct 23 10:41:27 2018 From: tom.rauchenwald at unifits.com (Tom Rauchenwald) Date: Tue, 23 Oct 2018 10:41:27 +0200 Subject: [basex-talk] Reflect.forName() / Performance References: <87h8hk93tg.fsf@rocket.unifits.intern> Message-ID: <87a7n5837s.fsf@rocket.unifits.intern> Hi Christian, > Your hint was helpful: If a function signature is not registered yet > when it is parsed, all kind of lookups are performed to locate the > function. This is e.g. the case if the function is recursive, or if > the invoked functions occurs after the currently parsed code. > > I have revised the code which is responsible for locating invoked > functions: In the JavaFunction class [1], the lookup will be avoided > if we can tell in advance that no Java class will be found. I did some non-scientific testing, the results are quite awesome. This is with one of our regression test suites, in this case we create 600 databases with exactly one (small) file, run a few queries against it (typically 3), and our business logic interprets the results (the use case is to check if some business rules are violated in the xml). Here are the results, the numbers are seconds to execute the full test suite: | | BaseX 8.6.1 | BaseX 9.0.2 | BaseX 9.1 Snapshot | |-----+-------------+-------------+--------------------| | 1 | 42.5 | 44.5 | 20.3 | | 2 | 42.5 | 44.4 | 18.1 | | 3 | 42.9 | 44.6 | 18.1 | | 4 | 42.5 | 44.8 | 18.2 | | 5 | 42.5 | 43.8 | 18.6 | |-----+-------------+-------------+--------------------| | Avg | 42.6 | 44.4 | 18.7 | So our case is now more than twice as fast as before :) I did some profiling/sampling with JProfiler as well, the Class.forName call is now almost completely gone, while it was the most-hit method before. I guess that means that improving the caching of classes is not needed, since you fixed the core problem. Thanks a lot, this really helps us a lot! -tom From mgaerber at arcor.de Tue Oct 23 14:36:19 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Tue, 23 Oct 2018 14:36:19 +0200 Subject: [basex-talk] Fwd: [dita-users] [ANN] XML Prague 2019 - Call for Proposals In-Reply-To: References: Message-ID: Just cross-posting to the Basex list ;-) ---------- Forwarded message --------- From: Jirka Kosek jirka at kosek.cz [dita-users] Date: Mo., 22. Okt. 2018 um 21:45 Uhr Subject: [dita-users] [ANN] XML Prague 2019 - Call for Proposals To: dita-users at yahoogroups.com Hello, we are glad to announce that call for proposals for XML Prague 2018 conference is open now. The XML Prague conference will include two full days of single track sessions as well as a multitrack unconference day. The conference is held on the Thursday, Friday and Saturday (February 7-9, 2019), located at the University of Economics, nam. W. Churchilla, Prague, Czech Republic. XML Prague is a conference on XML for developers, markup geeks, information managers, and students. XML Prague focuses on markup and semantic on the Web, publishing and digital books, XML technologies for Big Data and recent advances in XML technologies. The conference provides an overview of successful technologies, with a focus on real world application versus theoretical exposition. This years topics include the following: * Markup and the Extensible Web * Semantic visions and the reality * Publishing for the 21th century * XML technologies and Big Data * State of the XML Union * XML success stories Conference website: http://www.xmlprague.cz Call for proposals: http://www.xmlprague.cz/cfp/ Registration will be opened soon. Please take note of the following important ates: December 2nd ? End of CFP January 9th ? Notification of acceptance/rejection January 31st ? Final paper (for those who will provide it) February 7-9 ? XML Prague 2019 conference This year we would like to encourage new speakers -- full paper submission is no longer needed and there will be shorter slots available for those who would like to introduce/demo something "smaller". If you have any questions, interested in sponsorship or just want to make a suggestion please send email to: info at xmlprague.cz Jirka Kosek on behalf of XML Prague -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka at kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML and Web consulting and training services DocBook/DITA customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ Bringing you XML Prague conference http://xmlprague.cz ------------------------------------------------------------------ -------------- next part -------------- -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQRya5eRAjs9i3DpmvLPCZLDufR1HgUCW84owwAKCRDPCZLDufR1 HvGGAJ9pAEoDzANCL6sie7LjWiGZ14oakgCfV+SnOIWJDl8qJanDCT5eBMlDLUU= =Z4zC -----END PGP SIGNATURE----- From mgaerber at arcor.de Tue Oct 23 15:52:30 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Tue, 23 Oct 2018 15:52:30 +0200 Subject: [basex-talk] REQUEST REPLACE error In-Reply-To: References: Message-ID: Hi, you can check the limits: http://docs.basex.org/wiki/Statistics Could it be that you have more than 2'147'483'648 nodes in your db with the replace? Br, Max Am Di., 23. Okt. 2018 um 09:34 Uhr schrieb : > > Hello, > > we have currently 9 databases in our BaseX database. The biggest ones have about 9 GB, all together they have nearly 26 GB. Everything had worked fine until Friday. Since Friday, every time we sent REQUEST REPLACE command to any of those databases, it generated following error: > > 00:00:17.672 0.0.0.1:64492 admin REQUEST REPLACE Report\8f6a4b73-5be2-4246-b0ad-3baaec0fbd54 [...] 4.16 ms > 00:00:18.282 0.0.0.1:64492 admin ERROR Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 8.6.3 Java: Oracle Corporation, 1.8.0_171 OS: Windows Server 2012 R2, amd64 Stack Trace: java.lang.ArrayIndexOutOfBoundsException at org.basex.io.random.TableDiskAccess.insert(TableDiskAccess.java:347) at org.basex.data.Data.insert(Data.java:912) at org.basex.data.Data.insert(Data.java:739) at org.basex.query.up.atomic.Insert.apply(Insert.java:44) at org.basex.query.up.atomic.AtomicUpdateCache.applyUpdates(AtomicUpdateCache.java:297) at org.basex.query.up.atomic.AtomicUpdateCache.execute(AtomicUpdateCache.java:281) at org.basex.core.cmd.Replace.replace(Replace.java:104) at org.basex.core.cmd.Replace.access$0(Replace.java:69) at org.basex.core.cmd.Replace$1.run(Replace.java:57) at org.basex.core.cmd.ACreate.update(ACreate.java:90) at org.basex.core.cmd.Replace.run(Replace.java:54) at org.basex.core.Command.run(Command.java:257) at org.basex.core.Command.execute(Command.ja... 612.41 ms > > (It is from the log file.) We currently use BaseX version 8.6.3 Any idea why the error is generated and what could be the source of the problem? (Too big database? Too big databases all together? Some database lock?) > > Thank you in advance for your answer. > Best Regards, > > Radim Havlicek From m.lettere at gmail.com Tue Oct 23 18:14:41 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Tue, 23 Oct 2018 18:14:41 +0200 Subject: [basex-talk] Sir, when basex 9.1, please ;-) In-Reply-To: References: Message-ID: Yes Christian, it works with ws:emit() and I also understand the point now. This embedded support for websockets allows us to reduce our code base in some use cases by several hundreds lines of code. Not speaking about dependency management and configuration tricks to be documented. Great job! M. On 22/10/18 13:36, Christian Gr?n wrote: > Hi Marco, > > I?m glad to you are gathering some experience with the WebSocket facility. > >> I get the following error [2] as return to my HTTP POST and, ca va sans >> dire, nothing on the websocket. > The function bound to the "/dataprovider" is a simple RESTXQ function. > As such, it isn?t attached to a WebSocket id. One of the reasons is > that a client who?s using RESTXQ may not necessarily have a WebSocket > connection, or there can also be multiple WebSockets per client. > > If you want to send your result to all WebSockets ? including the > client that called the dataprovider ? you can simply use ws:emit(). If > your use case is complex enough to have a WebSocket connection and > simultaneous RESTXQ requests in a single browser tab, you could store > the WebSocket id(s) of your client as HTTP Session attribute, and > access these ids from the RESTXQ code. > >> BTW, even if not stated in the path annotation, an extra /ws needs to be >> prefixed to the url used for JS' WebSocket constructor. Personally I'd >> prefer to keep things explicit and put it in the annotation too. > I have just revised our documentation, and I hope it?s fairly complete > now. In the Annotations Section, you will find a hint to the "ws/" > path. > > The reason why the path is omitted in XQuery is that the web server > takes care of the path resolution. If the default path is changed in > the web.xml file, it would need to be changed in all XQuery > applications as well. The same applies to RESTXQ: If a prefix is used > in the configuration, there won?t be a need to change your path > annotations. > > Hope this helps, > Christian > > [1] http://docs.basex.org/wiki/WebSockets > > >> Thanks for your support and thanks Maximilian for the lift. >> >> [1] >> module namespace dp = 'urn:nubisware:datarouter'; >> >> import module namespace ws = 'http://basex.org/modules/ws'; >> >> declare >> %rest:path('/dataprovider') >> %rest:POST("{$data}") >> %output:method('json') >> function dp:route($data as node()) { >> ws:send(json:serialize($data), ws:ids()[. != ws:id()]) >> }; >> >> declare >> %ws:connect('/dataprovider') >> function dp:connect() as empty-sequence() { >> () >> }; >> >> declare >> %ws:close('/dataprovider') >> function dp:close() as empty-sequence() { >> () >> }; >> >> [2] >> Stopped at /home/lettere/tmp/basex/webapp/dataprovider/dataprovider.xqm, >> 11/53: >> [basex:ws] WebSocket connection required. >> >> On 18/10/18 18:33, Christian Gr?n wrote: >>> Sir, doing our best ;) >>> >>> We believe that BaseX 9.1 pretty soon (until end of October). >>> >>> For everyone who is interested in giving us some feedback on the new >>> WebSocket feature? Thank you in advance! 90% of the documentation is >>> finalized: >>> >>> http://docs.basex.org/wiki/WebSockets >>> >>> Best, >>> Christian >> From radu_coravu at sync.ro Wed Oct 24 10:56:25 2018 From: radu_coravu at sync.ro (Radu Coravu) Date: Wed, 24 Oct 2018 11:56:25 +0300 Subject: [basex-talk] Importing XML (DITA) validated with Relax NG schemas? In-Reply-To: References: Message-ID: <8715c3a9-c580-706b-5a60-3481a1baa589@sync.ro> Hi Christian, Thanks for the help, today I had more time to look into this, I added my observations on the opened issue: https://github.com/BaseXdb/basex/issues/1624#issuecomment-432572494 Regards, Radu Radu Coravu XML Editor http://www.oxygenxml.com On 10/19/2018 7:26 PM, Christian Gr?n wrote: > Hi Radu, > > Thanks for trying to get this working. > >> - I created a new database. >> - Added an XML document to the database, the XML document containing a >> reference to the RNG schema. > > Just a guess: You may need to supply the catalog before adding the > document to the database. In the GUI, if you open the Database ? New? > dialog, you can specify the file via the parser dialog. Adding the > path in the .basex file should work as well (it doesn?t matter if you > specify a local file path or a file:// URI). > >> Will I find that extra logging in the console I used to start >> "basexhttp.bat"? Or do I need to first configure the logging? > > If you start basex instances with the -d flag, you?ll get some more feedback. > > Hope this helps, further questions are welcome, > Christian > From mgaerber at arcor.de Wed Oct 24 14:58:26 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Wed, 24 Oct 2018 14:58:26 +0200 Subject: [basex-talk] Websocket chat and session Message-ID: Hi, we've chat working with the 9.1 snapshot. Also private message works but only if the BaseXHTTP class is used (embedded jetty). If we start the webapp with mvn jetty:run the session info seems to get lost (also in the DBA). Br, Max From echterhoff at interactive-instruments.de Wed Oct 24 15:02:46 2018 From: echterhoff at interactive-instruments.de (Johannes Echterhoff) Date: Wed, 24 Oct 2018 13:02:46 +0000 Subject: [basex-talk] determine index use in xquery:eval Message-ID: <19d5cb472b004878931573bf81f0d8ac@luna.interactive-instruments.de> Hello, Is there a way to determine if the query that is executed by xquery:eval(...) makes use of index information? Can we somehow obtain the optimized plan for that query? Best regards, Johannes -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Wed Oct 24 15:21:56 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Wed, 24 Oct 2018 15:21:56 +0200 Subject: [basex-talk] determine index use in xquery:eval In-Reply-To: <19d5cb472b004878931573bf81f0d8ac@luna.interactive-instruments.de> References: <19d5cb472b004878931573bf81f0d8ac@luna.interactive-instruments.de> Message-ID: Hi Johannes, As a single query may yield a large number of query plans if xquery:eval is repeatedly invoked, and as all of these plans will be created at runtime, we haven?t included the plans in the query optimization. However, if a query utilizes the index if it is run standalone, the index will also be used if xquery:eval is run, so you should be able to check some of your queries in advance. If your dynamic queries do not change, a good alternative is to use xquery:invoke; this might simplify your tests. Best, Christian On Wed, Oct 24, 2018 at 3:02 PM Johannes Echterhoff wrote: > > Hello, > > Is there a way to determine if the query that is executed by xquery:eval(?) makes use of index information? Can we somehow obtain the optimized plan for that query? > > Best regards, > > Johannes From echterhoff at interactive-instruments.de Wed Oct 24 15:42:13 2018 From: echterhoff at interactive-instruments.de (Johannes Echterhoff) Date: Wed, 24 Oct 2018 13:42:13 +0000 Subject: [basex-talk] determine index use in xquery:eval In-Reply-To: References: <19d5cb472b004878931573bf81f0d8ac@luna.interactive-instruments.de> Message-ID: <7df92f1a3f884cc09284b0b3004767fb@luna.interactive-instruments.de> Hi Christian, The tip regarding xquery:invoke was very useful. Looks like no indexes are applied. I'll have to investigate in more detail. Thank you for responding so quickly, Johannes -----Urspr?ngliche Nachricht----- Von: Christian Gr?n [mailto:christian.gruen at gmail.com] Gesendet: Mittwoch, 24. Oktober 2018 15:22 An: Johannes Echterhoff Cc: BaseX Betreff: Re: [basex-talk] determine index use in xquery:eval Hi Johannes, As a single query may yield a large number of query plans if xquery:eval is repeatedly invoked, and as all of these plans will be created at runtime, we haven?t included the plans in the query optimization. However, if a query utilizes the index if it is run standalone, the index will also be used if xquery:eval is run, so you should be able to check some of your queries in advance. If your dynamic queries do not change, a good alternative is to use xquery:invoke; this might simplify your tests. Best, Christian On Wed, Oct 24, 2018 at 3:02 PM Johannes Echterhoff wrote: > > Hello, > > Is there a way to determine if the query that is executed by xquery:eval(?) makes use of index information? Can we somehow obtain the optimized plan for that query? > > Best regards, > > Johannes From christian.gruen at gmail.com Wed Oct 24 16:41:12 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Wed, 24 Oct 2018 16:41:12 +0200 Subject: [basex-talk] Websocket chat and session In-Reply-To: References: Message-ID: Hi Max, Thanks for testing. > If we start the webapp with mvn jetty:run the session info seems to > get lost (also in the DBA). Could you tell us how your pom.xml looks like? I just updated the basex-api/pom.xml file, and I started the Jetty web server via "mvn jetty:run" from the basex-api directory of the BaseX source code, and everything seems to work. Cheers Christian From christian.gruen at gmail.com Wed Oct 24 16:43:18 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Wed, 24 Oct 2018 16:43:18 +0200 Subject: [basex-talk] Sir, when basex 9.1, please ;-) In-Reply-To: References: Message-ID: I?m glad to hear this! And thanks again for co-sponsoring this feature. People like you help us to keep BaseX alive and lively. On Tue, Oct 23, 2018 at 6:14 PM Marco Lettere wrote: > > Yes Christian, > it works with ws:emit() and I also understand the point now. > This embedded support for websockets allows us to reduce our code base > in some use cases by several hundreds lines of code. > Not speaking about dependency management and configuration tricks to be > documented. > Great job! > M. From mgaerber at arcor.de Wed Oct 24 17:59:22 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Wed, 24 Oct 2018 17:59:22 +0200 Subject: [basex-talk] Websocket chat and session In-Reply-To: References: Message-ID: Hi, I guess this is because we used to share the dba login and session key from 'cons.xqm' (which is does not exist anymore in 9.x) with our restxq app. Also, I guess we cloned a DBA version with a typo ;-) which seems already fixed: https://github.com/BaseXdb/basex/blob/aac439086539813ac12379a5f5ecb05f49dc6ef6/basex-api/src/main/webapp/dba/sessions/sessions.xqm#L45 Br, Max Am Mi., 24. Okt. 2018 um 16:41 Uhr schrieb Christian Gr?n : > > Hi Max, > > Thanks for testing. > > > If we start the webapp with mvn jetty:run the session info seems to > > get lost (also in the DBA). > > Could you tell us how your pom.xml looks like? > > I just updated the basex-api/pom.xml file, and I started the Jetty web > server via "mvn jetty:run" from the basex-api directory of the BaseX > source code, and everything seems to work. > > Cheers > Christian From dave.kopecek at gmail.com Thu Oct 25 20:16:47 2018 From: dave.kopecek at gmail.com (Dave Kopecek) Date: Thu, 25 Oct 2018 14:16:47 -0400 Subject: [basex-talk] Database Updates In-Reply-To: References: Message-ID: Christian, Thank you! That was exactly what I was looking for & somehow far simpler than I thought it needed to be. -Dave On Mon, Oct 15, 2018 at 9:07 AM Christian Gr?n wrote: > Hi Dave, > > here is one way to do it: > > declare context item := db:open('catalog'); > declare variable $update := 'daily-update.xml'; > > for $new in doc($update)//ENTRY > let $old := //ENTRY[SKU = $new/SKU] > return if($old) then ( > replace node $old with $new > ) else ( > insert node $new into /CATALOG/ENTRIES > ) > > Hope this helps, > Christian > > > On Sun, Oct 14, 2018 at 12:10 AM Dave Kopecek > wrote: > > > > Here are some tweaked examples & better problem definition: > > > > Given a database created from catalog.xml below, what's the best way to > update & add records received daily as in file daily-update.xml? > > > > For every node in daily-update.xml > > -- If ENTRY/SKU found in catalog.xml replace the entire node in > catalog.xml with the one from daily-update.xml > > -- If ENTRY/SKU not found in catalog.xml add the node from > daily-update.xml to catalog.xml > > > > catalog.xml > > > > > > > > > > 1 > > Empire Burlesque > > Dylan > > 10.90 > > > > > > 2 > > Hide your heart > > Bonnie Tyler > > 9.90 > > > > > > > > > > daily-update.xml > > > > > > > > > > 1 > > Empire Burlesque > > Bob Dylan > > 29.99 > > some value > > > > > > 5 > > Tupelo Honey > > Van Morrison > > 8.20 > > > > > > > > > > catalog.xml after daily update: > > > > > > > > 1 > > Empire Burlesque > > Bob Dylan > > 29.99 > > some value > > > > > > 2 > > Hide your heart > > Bonnie Tyler > > 9.90 > > > > > > 5 > > Tupelo Honey > > Van Morrison > > 8.20 > > > > > > > > > > Thanks, > > -Dave > > > > On Fri, Aug 17, 2018 at 11:27 AM Dave Kopecek > wrote: > >> > >> Hi All, > >> > >> Given a database created from catalog.xml below. What's the best way to > update & add records received daily as in file daily-update.xml ? > >> > >> Coming from relational DBs & new to this. I ultimately need to > script/automate this. Hoping there's some magic command I'm missing & > looking for best way to approach the problem. > >> > >> Thanks, > >> -Dave > >> > >> > >> catalog.xml > >> > >> > >> > >> > >> 1 > >> Empire Burlesque > >> Dylan > >> 10.90 > >> > >> > >> 2 > >> Hide your heart > >> Bonnie Tyler > >> 9.90 > >> > >> > >> > >> > >> daily-update.xml > >> > >> > >> > >> > >> 1 > >> 19.90 > >> I wasn't here before the update > >> > >> > >> 1971 > >> Tupelo Honey > >> Van Morrison > >> 8.20 > >> > >> > >> > >> > > > > > > -- > > DAVE KOPECEK OFFICE 607-431-8565 CELL 607-267-3449 > > 6 CROSS STREET, DELHI NY 13753 > -- *DAVE KOPECEK* OFFICE 607-431-8565 CELL *607-267-3449* 6 CROSS STREET, DELHI NY 13753 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sebastian.Wiemer at adesso.de Sat Oct 27 08:39:53 2018 From: Sebastian.Wiemer at adesso.de (Wiemer, Sebastian) Date: Sat, 27 Oct 2018 06:39:53 +0000 Subject: [basex-talk] fn:format-number() for german style numbers Message-ID: <3629AB0F-CC98-4B14-9C16-3439A884E168@adesso.de> An HTML attachment was scrubbed... URL: From martin.honnen at gmx.de Sat Oct 27 09:26:00 2018 From: martin.honnen at gmx.de (Martin Honnen) Date: Sat, 27 Oct 2018 09:26:00 +0200 Subject: [basex-talk] fn:format-number() for german style numbers In-Reply-To: <3629AB0F-CC98-4B14-9C16-3439A884E168@adesso.de> References: <3629AB0F-CC98-4B14-9C16-3439A884E168@adesso.de> Message-ID: <96ed5258-b530-7765-4b76-bb1a15132ac3@gmx.de> Am 27.10.2018 um 08:39 schrieb Wiemer, Sebastian: > > > How do I format german style numbers e.g.: 1.000.00,99? (for one > million ? and 99cents) ? > The following approach: > > format-number(26825.8, '#.###,00') > > yielded an error:?[FODF1310] Invalid picture string: '#.###,00'. > > See https://www.w3.org/TR/xquery-31/#id-decimal-format-decl declare decimal-format local:de ? decimal-separator = "," grouping-separator = "."; format-number(26825.8, '#.###,00', 'local:de') -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter.zanzinger at icloud.com Sat Oct 27 16:09:50 2018 From: dieter.zanzinger at icloud.com (Dieter Zanzinger) Date: Sat, 27 Oct 2018 16:09:50 +0200 Subject: [basex-talk] BaseX-standard-installation-with-embedded-jetty-- how to deploy other webapp Message-ID: <7D028D6C-EA12-4D4B-A37B-2949BC815517@icloud.com> Dear BaseX-fellows, the websocket-feature in 9.1 is great. Now- to use ist, I need the BaseX-Version with embedded Jetty. My problem is, that I need another web app, too. Up to now, I used Tomcat as container for BaseX and the other webapp. Is it possible, to deploy another app in the embedded Jetty ? Any hints, how to do that? In Tomcat and - as far as I know in a standard Jetty installation - I just copy the .war into the webapps-Folder. That doesn?t work in the embedded Jetty. I would be glad for hints. Sincerely Dieter Zanzinger From mgaerber at arcor.de Sat Oct 27 20:13:58 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Sat, 27 Oct 2018 20:13:58 +0200 Subject: [basex-talk] BaseX-standard-installation-with-embedded-jetty-- how to deploy other webapp In-Reply-To: <7D028D6C-EA12-4D4B-A37B-2949BC815517@icloud.com> References: <7D028D6C-EA12-4D4B-A37B-2949BC815517@icloud.com> Message-ID: Hello Dieter, I've just tested 9.1 - and sockets (started with mvn jetty:run), worked without issues. All you need is the jetty maven plugin, configured like https://github.com/BaseXdb/basex/blob/master/basex-api/pom.xml#L107 If you start the BaseXHTTP class, it starts Jetty from code but also tries to load the WEB-INF/web.xml file. For example, to add the SparkJava filters, I've just added the and it was picked up correclty at /spark/* SparkFilter spark.servlet.SparkFilter applicationClass com.example.spark.MySparkApplication SparkFilter /spark/* Br, Max Am Sa., 27. Okt. 2018 um 16:09 Uhr schrieb Dieter Zanzinger : > > Dear BaseX-fellows, > > the websocket-feature in 9.1 is great. Now- to use ist, I need the BaseX-Version with embedded Jetty. > My problem is, that I need another web app, too. Up to now, I used Tomcat as container for BaseX and the other webapp. > Is it possible, to deploy another app in the embedded Jetty ? Any hints, how to do that? > In Tomcat and - as far as I know in a standard Jetty installation - I just copy the .war into the webapps-Folder. That doesn?t work in the embedded Jetty. > > I would be glad for hints. > > Sincerely > Dieter Zanzinger From mixich.andreas at gmail.com Sun Oct 28 13:34:32 2018 From: mixich.andreas at gmail.com (Andreas Mixich) Date: Sun, 28 Oct 2018 13:34:32 +0100 Subject: [basex-talk] How to pass an XPath expression as parameter? Message-ID: Is there a way to do something like this? declare function local:insert( $doc as node(), $at-location as xpath(), (: I know, there is no 'xpath' type, this is just for demo :) $what as node()* ) as node() { copy $c := $doc modify insert node $what into $at-location return $c }; let $xml :=

This is a paragraph.

let $nd :=
Test return local:insert($xml, xpath("/body"), $nd) As I see it, it would need a dynamic xs:string => XPath expression conversion or a defer XPath expression, which both do not exist, for $at-location. I managed to do this, however: declare function local:insert($doc, $at-location, $what) { let $update := ``[ declare variable $doc external; declare variable $what external; declare variable $at-location external; copy $c := $doc modify insert node $what into `{$at-location}` return $c ]`` return xquery:eval($update, map{ 'doc':$doc, 'at-location':$at-location, '$what':$what }) }; let $xml :=

This is a paragraph.

let $node := Test return local:insert($xml, "$c/body", $node) Ideally (for me), there would be a 'defer' XPath expression, that starts its life as a string (when passed) and then unfolds upon call. Or a type (or function) fn:xpath(), that behaves that way. Or am I just blind and don't see the obvious, and there *is* a simpler solution? -- Minden j?t, all the best, Alles Gute, Andreas Mixich -------------- next part -------------- An HTML attachment was scrubbed... URL: From mixich.andreas at gmail.com Sun Oct 28 17:18:34 2018 From: mixich.andreas at gmail.com (Andreas Mixich) Date: Sun, 28 Oct 2018 17:18:34 +0100 Subject: [basex-talk] How to pass an XPath expression as parameter? In-Reply-To: References: Message-ID: I just realized, that there is another, simpler way to simulate a defer XPath expression. So I ended up using: declare function local:add-node( $input as node()*, $what as node()* ) as node() { copy $c := $input modify insert node $what into $c return $c }; declare function local:add-node( $input as node()*, $what as node()*, $at-location as xs:string ) as node() { copy $c := $input modify let $xpath := xquery:eval($at-location, map{"":$c}) return insert node $what into $c/$xpath return $c }; => local:add-node((,)) => local:add-node(Example Title, "head") -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Mon Oct 29 15:24:44 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Mon, 29 Oct 2018 15:24:44 +0100 Subject: [basex-talk] How to pass an XPath expression as parameter? In-Reply-To: References: Message-ID: Hi Andreas, If your dynamic path is simple, you can get rid of xquery:eval and replace it with a fold-left iteration (see the attached example). The programmatic solution may be safer, in particular if the supplied path may be the result of external user input. Obviously, you?ll need to ensure in both cases that the resulting target node is a single element node. Cheers, Christian declare function local:add-nodes1( $input as node(), $nodes as node()*, $path as xs:string ) as node() { $input update { let $target := xquery:eval($path, map { '': . }) return insert nodes $nodes into $target } }; declare function local:add-nodes2( $input as node(), $nodes as node()*, $path as xs:string ) as node() { $input update { let $steps := tokenize($path, '/') let $target := fold-left($steps, ., function($node, $name) { $node/*[name() = $name] }) return insert nodes $nodes into $target } }; => local:add-nodes1(, 'a/b') => local:add-nodes2(, 'a/b') On Sun, Oct 28, 2018 at 5:19 PM Andreas Mixich wrote: > > I just realized, that there is another, simpler way to simulate a defer XPath expression. So I ended up using: > > declare function local:add-node( > $input as node()*, > $what as node()* > ) as node() { > copy $c := $input > modify insert node $what into $c > return $c > }; > declare function local:add-node( > $input as node()*, > $what as node()*, > $at-location as xs:string > ) as node() { > copy $c := $input > modify > let $xpath := xquery:eval($at-location, map{"":$c}) > return > insert node $what into $c/$xpath > return $c > }; > > > => local:add-node((,)) > => local:add-node(Example Title, "head") > From radim-havlicek at post.cz Tue Oct 30 09:41:45 2018 From: radim-havlicek at post.cz (radim-havlicek at post.cz) Date: Tue, 30 Oct 2018 09:41:45 +0100 (CET) Subject: [basex-talk] slow DB when updating Message-ID: <}}r.fcXW.18aGZHVXpQo.1Rs1b9@seznam.cz> Hello, when one client is uploading file to a database (let's say Database1),?upd. basex file is created and exists until the file is uploaded to the database Database1. Problem is that meanwhile the upload is running, all other clients reading data from the Database1 read the data very, very slowly. Also clients trying to read data from Database2 or Database3 reads the data very, very slowly while the upload to Database1 is running. Also the client trying to upload data to Database2 is not successful until the upload to Database1 is done. Database1, Database2 and Database3 are databases in the same BaseX database. Can I speed up the loading data from various databases at the same time or the parallel uploading? I've read about the PARALLEL option in?.basex option file, but are there any best practices what the value should be regarding to the?database size or the number of databases? And are there similar best practices to?CACHETIMEOUT,?TIMEOUT and KEEPALIVE options? Are there more information than what is at http://docs.basex.org/wiki/Options ? Thanks for your reply in advance. Best regards, Radim Havlicek -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Tue Oct 30 09:50:11 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Tue, 30 Oct 2018 09:50:11 +0100 Subject: [basex-talk] slow DB when updating In-Reply-To: <}}r.fcXW.18aGZHVXpQo.1Rs1b9@seznam.cz> References: <}}r.fcXW.18aGZHVXpQo.1Rs1b9@seznam.cz> Message-ID: Hi Radim, > when one client is uploading file to a database (let's say Database1), upd.basex file is created and exists until the file is uploaded to the database Database1. Problem is that meanwhile the upload is running, all other clients reading data from the Database1 read the data very, very slowly. Also clients trying to read data from Database2 or Database3 reads the data very, very slowly while the upload to Database1 is running. Also the client trying to upload data to Database2 is not successful until the upload to Database1 is done. In our article on Transactions [1], you?ll learn about how concurrent read and write operations are handled in BaseX. In general, if you write to Database1, you can read/write Database2 in parallel. Could you tell us more about how you ?upload? documents to a database? If you work with the HTTP architecture, and if the process of uploading a document takes long in itself, you could use RESTXQ and process client input in multiple steps (e.g. insert the document only in the database after it has been fully retrieved by the server). D?kuji & pozdravy, Christian [1] http://docs.basex.org/wiki/Transactions > Database1, Database2 and Database3 are databases in the same BaseX database. > > Can I speed up the loading data from various databases at the same time or the parallel uploading? I've read about the PARALLEL option in .basex option file, but are there any best practices what the value should be regarding to the database size or the number of databases? And are there similar best practices to CACHETIMEOUT, TIMEOUT and KEEPALIVE options? Are there more information than what is at http://docs.basex.org/wiki/Options ? > > Thanks for your reply in advance. > Best regards, > > Radim Havlicek From christian.gruen at gmail.com Tue Oct 30 14:13:29 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Tue, 30 Oct 2018 14:13:29 +0100 Subject: [basex-talk] Programmatically extracting function signatures In-Reply-To: References: Message-ID: Hi Bridger, I am glad to report I have created new stub files for the BaseX XQuery Modules [1]. They?ll now be included in the official releases again [2]. I have also uploaded the script that I wrote for generating the xqdoc output [3]. It?s far from perfect, but definitely more complete than the old version. If you encounter any errors, please don?t hesitate to tell me. Could you give us a little update on your contribution to the IntelliJ XQuery plugin? Cheers, Christian [1] https://github.com/BaseXdb/basex/issues/1623 [2] http://files.basex.org/releases/latest/ [3] https://github.com/BaseXdb/basex-dist/blob/master/wiki2xqdoc.xq On Mon, Sep 17, 2018 at 5:38 PM Bridger Dyson-Smith wrote: > > Hi all - > > I was curious if there was a way to extract function signatures from BaseX. I'm currently reading through the (excellent) wiki but was curious if there was a more automated process I might be able to use. I've been trying to think of something clever with function-lookup, but I can't seem to make it dynamic based on module namespace; e.g. > > ``` > for $fun in function-lookup(xs:QName("archive:delete"), 1) > return > $fun > ``` > > I may just grab the wiki and parse it :), but I'm also interested in changes between versions of the processor. > > Any thoughts or suggestions would be greatly appreciated! > Best, > Bridger From Paul.P.Han at boeing.com Tue Oct 30 15:06:55 2018 From: Paul.P.Han at boeing.com (Han (US), Paul P) Date: Tue, 30 Oct 2018 14:06:55 +0000 Subject: [basex-talk] ArrayIndexOutOfBoundsException: Maximum array size reached Message-ID: Hello, We encountered the below error when using this API: archive:extract-to($tempDirPath, file:read-binary($zipFilePath)). The zip file size is 51396593 and the inflated file size is 2796146027. Please let me know if you need additional information. We expect our data files to be at least 10 times bigger than these numbers. POST failed with response 400: Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 9.0.2 Java: Oracle Corporation, 1.8.0_121 OS: Linux, amd64 Stack Trace: java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached. at org.basex.util.Array.newSize(Array.java:238) at org.basex.util.Array.newSize(Array.java:227) at org.basex.io.out.ArrayOutput.write(ArrayOutput.java:32) at java.io.OutputStream.write(OutputStream.java:116) at org.basex.query.func.archive.ArchiveIn.read(ArchiveIn.java:77) at org.basex.query.func.archive.ArchiveExtractTo.item(ArchiveExtractTo.java:40) at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:48) at org.basex.query.scope.MainModule.iter(MainModule.java:118) at org.basex.query.QueryContext.iter(QueryContext.java:330) at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90) at org.basex.core.cmd.AQuery.query(AQuery.java:100) at org.basex.core.cmd.XQuery.run(XQuery.java:22) at org.basex.core.Command.run(Command.java:257) at org.basex.http.rest.RESTCmd.run(RESTCmd.java:105) at org.basex.http.rest.RESTQuery.query(RESTQuery.java:69) at org.basex.http.rest.RESTQuery.run0(RESTQuery.java:37) at org.basex.http.rest.RESTCmd.run(RESTCmd.java:70) at org.basex.core.Command.run(Command.java:257) at org.basex.core.Command.execute(Command.java:93) at org.basex.core.Command.execute(Command.java:116) at org.basex.http.rest.RESTServlet.run(RESTServlet.java:27) at org.basex.http.BaseXServlet.service(BaseXServlet.java:59) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:419) at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:169) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Regards, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Tue Oct 30 15:24:01 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Tue, 30 Oct 2018 15:24:01 +0100 Subject: [basex-talk] ArrayIndexOutOfBoundsException: Maximum array size reached In-Reply-To: References: Message-ID: Hi Paul, I have optimized the implementation of archive:extract-to. Archive contents will now be directly output to the local file system [1,2]. Best, Christian [1] http://files.basex.org/releases/latest/ [2] https://github.com/BaseXdb/basex/commit/8de6dceb2b7f9c56afa6c258a5f2a3c094fec937 On Tue, Oct 30, 2018 at 3:07 PM Han (US), Paul P wrote: > > Hello, > > We encountered the below error when using this API: archive:extract-to($tempDirPath, file:read-binary($zipFilePath)). The zip file size is 51396593 and the inflated file size is 2796146027. Please let me know if you need additional information. We expect our data files to be at least 10 times bigger than these numbers. > > POST failed with response 400: Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 9.0.2 > Java: Oracle Corporation, 1.8.0_121 > OS: Linux, amd64 > Stack Trace: > java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached. > at org.basex.util.Array.newSize(Array.java:238) > at org.basex.util.Array.newSize(Array.java:227) > at org.basex.io.out.ArrayOutput.write(ArrayOutput.java:32) > at java.io.OutputStream.write(OutputStream.java:116) > at org.basex.query.func.archive.ArchiveIn.read(ArchiveIn.java:77) > at org.basex.query.func.archive.ArchiveExtractTo.item(ArchiveExtractTo.java:40) From Paul.P.Han at boeing.com Tue Oct 30 16:51:11 2018 From: Paul.P.Han at boeing.com (Han (US), Paul P) Date: Tue, 30 Oct 2018 15:51:11 +0000 Subject: [basex-talk] ArrayIndexOutOfBoundsException: Maximum array size reached In-Reply-To: References: Message-ID: <344bfd582b7d4350a85405f498469d81@XCH15-07-08.nw.nos.boeing.com> Hi Christian, I have verified your changes. Thank you so much for quick response. Regards, Paul -----Original Message----- From: Christian Gr?n [mailto:christian.gruen at gmail.com] Sent: Tuesday, October 30, 2018 7:24 AM To: Han (US), Paul P Cc: BaseX Subject: Re: [basex-talk] ArrayIndexOutOfBoundsException: Maximum array size reached Hi Paul, I have optimized the implementation of archive:extract-to. Archive contents will now be directly output to the local file system [1,2]. Best, Christian [1] http://files.basex.org/releases/latest/ [2] https://github.com/BaseXdb/basex/commit/8de6dceb2b7f9c56afa6c258a5f2a3c094fec937 On Tue, Oct 30, 2018 at 3:07 PM Han (US), Paul P wrote: > > Hello, > > We encountered the below error when using this API: archive:extract-to($tempDirPath, file:read-binary($zipFilePath)). The zip file size is 51396593 and the inflated file size is 2796146027. Please let me know if you need additional information. We expect our data files to be at least 10 times bigger than these numbers. > > POST failed with response 400: Improper use? Potential bug? Your feedback is welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 9.0.2 > Java: Oracle Corporation, 1.8.0_121 > OS: Linux, amd64 > Stack Trace: > java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached. > at org.basex.util.Array.newSize(Array.java:238) > at org.basex.util.Array.newSize(Array.java:227) > at org.basex.io.out.ArrayOutput.write(ArrayOutput.java:32) > at java.io.OutputStream.write(OutputStream.java:116) > at org.basex.query.func.archive.ArchiveIn.read(ArchiveIn.java:77) > at > org.basex.query.func.archive.ArchiveExtractTo.item(ArchiveExtractTo.ja > va:40) From christian.gruen at gmail.com Wed Oct 31 17:34:20 2018 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Wed, 31 Oct 2018 17:34:20 +0100 Subject: [basex-talk] BaseX 9.1: The Autumn Edition In-Reply-To: References: Message-ID: Dear XML and XQuery aficionados, It?s been exactly 5 months ago when BaseX 9 was released, and we are happy to announce version 9.1 of our XML framework, database system and XQuery 3.1 processor! The latest release is online: http://basex.org The most exciting addition is support for WebSockets, which enable you to do bidirectional (full-duplex) client/server communication with XQuery web applications: http://docs.basex.org/wiki/WebSockets Moreover, we have added convenient syntax extensions (ternary if, Elvis operator, if without else) to XQuery. Some of them may be made available in other implementations of XQuery as well (we?ll keep you updated): http://docs.basex.org/wiki/XQuery_Extensions#Expressions Other new features are as follows: XQuery: - set local locks via pragmas and function annotations - Database Module: faster processing of value index functions - Jobs Module: record and return registration times - ENFORCEINDEX option: support for predicates with dynamic values - Update Module, update:output: support for caching maps and arrays GUI: - Mac, Windows: Improved rendering support for latest Java versions - XQuery editor: choose and display current query context Visit http://docs.basex.org to get more information on the added features. Your feedback is welcome! Have fun, Christian BaseX Team From m.lettere at gmail.com Wed Oct 31 17:38:34 2018 From: m.lettere at gmail.com (Marco Lettere) Date: Wed, 31 Oct 2018 17:38:34 +0100 Subject: [basex-talk] BaseX 9.1: The Autumn Edition In-Reply-To: References: Message-ID: CHEERS! M. On 31/10/18 17:34, Christian Gr?n wrote: > Dear XML and XQuery aficionados, > > It?s been exactly 5 months ago when BaseX 9 was released, and we are > happy to announce version 9.1 of our XML framework, database system > and XQuery 3.1 processor! The latest release is online: > > http://basex.org > > The most exciting addition is support for WebSockets, which enable you > to do bidirectional (full-duplex) client/server communication with > XQuery web applications: > > http://docs.basex.org/wiki/WebSockets > > Moreover, we have added convenient syntax extensions (ternary if, > Elvis operator, if without else) to XQuery. Some of them may be made > available in other implementations of XQuery as well (we?ll keep you > updated): > > http://docs.basex.org/wiki/XQuery_Extensions#Expressions > > Other new features are as follows: > > XQuery: > - set local locks via pragmas and function annotations > - Database Module: faster processing of value index functions > - Jobs Module: record and return registration times > - ENFORCEINDEX option: support for predicates with dynamic values > - Update Module, update:output: support for caching maps and arrays > > GUI: > - Mac, Windows: Improved rendering support for latest Java versions > - XQuery editor: choose and display current query context > > Visit http://docs.basex.org to get more information on the added features. > > Your feedback is welcome! Have fun, > > Christian > BaseX Team From mgaerber at arcor.de Wed Oct 31 19:14:01 2018 From: mgaerber at arcor.de (=?UTF-8?Q?Maximilian_G=C3=A4rber?=) Date: Wed, 31 Oct 2018 19:14:01 +0100 Subject: [basex-talk] BaseX 9.1: The Autumn Edition In-Reply-To: References: Message-ID: Good news and great work! Am Mi., 31. Okt. 2018 um 17:34 Uhr schrieb Christian Gr?n : > > Dear XML and XQuery aficionados, > > It?s been exactly 5 months ago when BaseX 9 was released, and we are > happy to announce version 9.1 of our XML framework, database system > and XQuery 3.1 processor! The latest release is online: > > http://basex.org > > The most exciting addition is support for WebSockets, which enable you > to do bidirectional (full-duplex) client/server communication with > XQuery web applications: > > http://docs.basex.org/wiki/WebSockets > > Moreover, we have added convenient syntax extensions (ternary if, > Elvis operator, if without else) to XQuery. Some of them may be made > available in other implementations of XQuery as well (we?ll keep you > updated): > > http://docs.basex.org/wiki/XQuery_Extensions#Expressions > > Other new features are as follows: > > XQuery: > - set local locks via pragmas and function annotations > - Database Module: faster processing of value index functions > - Jobs Module: record and return registration times > - ENFORCEINDEX option: support for predicates with dynamic values > - Update Module, update:output: support for caching maps and arrays > > GUI: > - Mac, Windows: Improved rendering support for latest Java versions > - XQuery editor: choose and display current query context > > Visit http://docs.basex.org to get more information on the added features. > > Your feedback is welcome! Have fun, > > Christian > BaseX Team From chipfromm at mail.ru Wed Oct 31 22:47:02 2018 From: chipfromm at mail.ru (=?UTF-8?B?0KHQtdGA0LPQtdC5INCn0LXRgdC90L7QutC+0LI=?=) Date: Thu, 01 Nov 2018 00:47:02 +0300 Subject: [basex-talk] =?utf-8?q?many_distinct_namespaces?= Message-ID: <1541022422.882950422@f403.i.mail.ru> Hi all, Is it possible to bypass the following restriction (I cannot change "ep_ins_med_q.xsd" (Central Bank xbrl scheme))?: BaseX 9.1 Command: CREATE DB bfo D:/portal/xbrl/CBR/final_1_3_1/Taxonomy_1_3_1/www.cbr.ru/xbrl/bfo/ Error: "D:/portal/xbrl/CBR/final_1_3_1/Taxonomy_1_3_1/www.cbr.ru/xbrl/bfo/rep/2018-03-31/ep/ep_ins_med_q.xsd""ep_ins_med_q.xsd" (Line 21): Too many distinct namespaces (limit: 256). Best regards, Sergei. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit.imsieke at le-tex.de Wed Oct 31 23:40:42 2018 From: gerrit.imsieke at le-tex.de (Imsieke, Gerrit, le-tex) Date: Wed, 31 Oct 2018 23:40:42 +0100 Subject: [basex-talk] many distinct namespaces In-Reply-To: <1541022422.882950422@f403.i.mail.ru> References: <1541022422.882950422@f403.i.mail.ru> Message-ID: <39e0d303-f8eb-3180-a6ec-c9aacb3a44a5@le-tex.de> Hi Sergei, The corresponding issue will turn 5 next March: https://github.com/BaseXdb/basex/issues/902 If you are an XML developer who wants to index all the XML, XSLT, XProc, RNG, XSD, Schematron, etc. files on your hard disk in an XML database, chances are that you?ll need more than 256 namespaces. I?m willing to shell out up to 1,200 Euros (plus VAT) out of my own pockets for this feature. Any other funders? Christian, how much do we need to raise collectively for you to prioritize storage layout redesign? Gerrit On 31.10.2018 22:47, ?????? ???????? wrote: > > Hi all, > > Is it possible to bypass the following restriction (I cannot change > "ep_ins_med_q.xsd" (Central Bank xbrl scheme))?: > > BaseX 9.1 > > Command: > CREATE DB bfo > D:/portal/xbrl/CBR/final_1_3_1/Taxonomy_1_3_1/www.cbr.ru/xbrl/bfo/ > Error: > "D:/portal/xbrl/CBR/final_1_3_1/Taxonomy_1_3_1/www.cbr.ru/xbrl/bfo/rep/2018-03-31/ep/ep_ins_med_q.xsd""ep_ins_med_q.xsd" > (Line 21): Too many distinct namespaces (limit: 256). > > Best regards, Sergei. -- Gerrit Imsieke Gesch?ftsf?hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke at le-tex.de, http://www.le-tex.de Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930 Gesch?ftsf?hrer / Managing Directors: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt