[basex-talk] how to start and configure Jetty?
I don't quite understand what it means for Jetty to be "embedded" in or with BaseX, but presumably there's a configuration? I see: |DEBUG =falseDBPATH =/home/nicholas/basex/data LOGPATH =.logs REPOPATH =/home/nicholas/basex/repo LANG =EnglishLANGKEYS =falseFAIRLOCK =falseCACHETIMEOUT =3600#Client/ServerArchitectureHOST =localhost PORT =1984SERVERPORT =1984USER =PASSWORD =SERVERHOST =PROXYHOST =PROXYPORT =0NONPROXYHOSTS =IGNORECERT =falseIGNOREHOSTNAME =falseTIMEOUT =30KEEPALIVE =600PARALLEL =8LOG =trueLOGMSGMAXLEN =1000#HTTP ServicesWEBPATH =/home/nicholas/basex/webapp RESTPATH =RESTXQPATH =PARSERESTXQ =3HTTPLOCAL =falseSTOPPORT =8985AUTHMETHOD =Basic but there's nothing actually at WEBPATH, no directory. Perhaps RESTXQPATH requires configuration? Really, just guessing. See also: https://askubuntu.com/q/1252599/847449 If I installed BaseX with apt, should it also pull in Jetty, then? thanks, Nick |
[basex-talk] trying to rename all node elements from to
Hi, How do I rename all the "record" nodes in a database? I'm trying: for $x in db:open("bccdc_covid19") return return rename node $x//record as "baz" but this gives back Stopped at ., 1/13: [XPDY0002] bc.rename.xq: no context value bound. or [XPST0003] Unexpected end of query: 'rename node $x/...'. depending whether it's run from within the basex console. thanks, Nick
Re: [basex-talk] trying to rename all node elements from to
Pardon, this indeed works: for $x in db:open("bccdc_covid19") return rename node $x//baz as "foo" but only for the first node baz -- how can I rename all of the nodes? Or match an Xpath? It's CSV data, so the general layout (?) is csv/record/entry and instead of "record" I'd want that to be something else -- doesn't really matter what.
Re: [basex-talk] A first RESTXQ function
Hi Christian, Ah, it's step #3 where I seem to run into a roadblock. I'll look into that more closely. thanks, Nick On 11/19/20 1:49 AM, Christian Grün wrote: Hi Nicholas, A good start is to: 1. download the full distribution of BaseX 2. run basexhttp, 3. visit http://localhost:8984, 4. open the BaseX GUI and look at the files in the webapp directory. You can modify some of these files and see what your browser does. Cheers, Christian On Tue, Nov 17, 2020 at 9:36 PM Nicholas wrote: For this example: module namespace page = 'http://basex.org/examples/web-page'; declare %rest:path("hello/{$who}") %rest:GET function page:hello($who) { Hello { $who }! }; https://docs.basex.org/wiki/RESTXQ where/how is this function stored or saved? thanks, Nick
Re: [basex-talk] RESTXQ and posting files
if you were to put your efforts on github, I'd certainly be interested. On 11/19/20 6:10 PM, cel...@informatik.uni-leipzig.de wrote: Hi, I have a script which takes a path to an xml or txt file as an input and outputs its content (as xml or txt) after a few modifications have been applied. I would like to make the script available as a RESTXQ application, but it is not clear to me how I can specify, in a RESTXQ function, that an xml or txt file should be accepted as an input. I have been able to post by sending the content of an entire file as a string, but I guess there is a specific way to handle files. Ciao, Giuseppe
Re: [basex-talk] where is the "lib" folder?
On 11/23/20 3:21 AM, Omar Siam wrote: Hi, Am 23.11.2020 um 10:57 schrieb Nicholas: Is there even a lib directory? https://unix.stackexchange.com/a/621089/101935 My understanding is that, for example, a JDBC driver can be "added" to BaseX itself. Perhaps this is incorrect. Adding JAR libraries is a matter of setting the CLASSPATH correctly. It seems the Debian package is very minmalistic. I have to admit I never used it. The lib folder and tho lib/custom folder are obvious if you download the ZIP distribution (see https://basex.org/download/). If you only work with the (GUI) single jar file or as it seems the maven distribution here, things are more complicated if they work at all. You can look at the start scripts (probably shell scripts) and compare them to what the ZIPed versions do. Perhaps you can try the ZIP version first before searching any further. Best regards Omar Siam It would seem that the Debian/Ubuntu package just doesn't have a lib folder. I wouldn't pretend to understand why that's so, nor why the directory can't simply be added, but that's the scenario. The full download includes a lib folder. -Nick
[basex-talk] set parser csv header
How do I set the CSV parser to use "header" true? so that when the record is imported it has the header information as below? nicholas@mordor:~/flwor/csv$ nicholas@mordor:~/flwor/csv$ basex BaseX 9.0.1 [Standalone] Try 'help' to get more information. > > create database addressbook Database 'addressbook' created in 240.02 ms. > > open addressbook Database 'addressbook' was opened in 0.06 ms. > > set parser csv PARSER: csv > > add addressbook.csv Resource(s) added in 23.74 ms. > > xquery . Name First Name Address City Huber Sepp Hauptstraße 13 93547 Hintertupfing Query executed in 219.65 ms. > > exit Enjoy life. nicholas@mordor:~/flwor/csv$ nicholas@mordor:~/flwor/csv$ basex addressbook.xq Huber Sepp Hauptstraße 13 93547 Hintertupfing nicholas@mordor:~/flwor/csv$ nicholas@mordor:~/flwor/csv$ nicholas@mordor:~/flwor/csv$ cat addressbook.csv Name,First Name,Address,City Huber,Sepp,Hauptstraße 13,93547 Hintertupfing nicholas@mordor:~/flwor/csv$ nicholas@mordor:~/flwor/csv$ cat addressbook.xq xquery version "3.1"; let $text := file:read-text('addressbook.csv') return csv:parse($text, map { 'header': true() }) nicholas@mordor:~/flwor/csv$ see also: https://stackoverflow.com/q/65275618/4531180 thanks, Nick
Re: [basex-talk] write result to file?
pardon, forgot to include: https://tech.forums.softwareag.com/t/writing-to-file-using-xquery/67224 where michael kay says that's just not going to work. similarly, I'd want to feed the result into an xslt. On 12/15/20 9:15 AM, Nicholas wrote: how is the return result from a query written to a file? thanks, Nick
[basex-talk] write result to file?
how is the return result from a query written to a file? thanks, Nick
Re: [basex-talk] write result to file?
On 12/15/20 11:38 AM, Liam R. E. Quin wrote: On Tue, 2020-12-15 at 09:19 -0800, Nicholas wrote: pardon, forgot to include: https://tech.forums.softwareag.com/t/writing-to-file-using-xquery/67224 where michael kay says that's just not going to work. That's not exactly what he says - Mike words himself very carefully most of the time. If you want to run XSLT on the result of a query you can use fn:transform() to do that from within XQuery, and you can write the result with file:write(), yes. Using xsl:resut-document from XSLT won't write anything out in that situation but will put the results into a map that your XQuery expression can save to a file. You could also use an XProc pipeline, of course. But it depends on your situation and needs. Liam Fair enough, that was at least my takeaway. For the post-processing he mentions, this might be with xsl:result-document as suggested? thanks, Nick
Re: [basex-talk] write result to file?
ah, I see, it's using expath? |file:write|($file as|xs:string|, $items as|item()*|) as|empty-sequence()| |file:write|($file as|xs:string|, $items as|item()*|, $params as|element(output:serialization-parameters)|) as|empty-sequence() something like that? | On 12/15/20 9:15 AM, Nicholas wrote: how is the return result from a query written to a file? thanks, Nick
[basex-talk] A first RESTXQ function
For this example: module namespace page = 'http://basex.org/examples/web-page'; declare %rest:path("hello/{$who}") %rest:GET function page:hello($who) { Hello { $who }! }; https://docs.basex.org/wiki/RESTXQ where/how is this function stored or saved? thanks, Nick
[basex-talk] importing data from powershell
for some simple data as: PS /home/nicholas> PS /home/nicholas> $data = @{ >> customer = 'something' >> name = 'whatever' >> } PS /home/nicholas> PS /home/nicholas> ($data | ConvertTo-Xml).OuterXml Type="System.Collections.Hashtable">Type="System.String">nameType="System.String">whateverType="System.String">customerType="System.String">something PS /home/nicholas> what would be some different ways of importing this data into BaseX? Certainly, the above XML can simply be written to a file, but what might something, from within powershell, a bit more automated? thanks, Nick
[basex-talk] where is the "lib" folder?
Is there even a lib directory? https://unix.stackexchange.com/a/621089/101935 My understanding is that, for example, a JDBC driver can be "added" to BaseX itself. Perhaps this is incorrect. thanks, Nick
[basex-talk] missing web.xml from docker image
I've just opened an issue: https://github.com/BaseXdb/basex/issues/1936 based on an inability to run the docker image: https://devops.stackexchange.com/q/12338/23443 but thought I'd ask here if there might be something obvious. I'm creating the container from the hub image with: docker run -d \ --name basexhttp \ --publish 1984:1984 \ --publish 8984:8984 \ --volume "$HOME/basex/data":/srv/basex/data \ --volume "$HOME/basex/repo":/srv/basex/repo \ --volume "$HOME/basex/webapp":/srv/basex/webapp \ basex/basexhttp:latest and another person reported the missing file. Is the file missing? I'm not sure.
Re: [basex-talk] missing web.xml from docker image
from what I gather, the link command is deprecated: it sounds like you are using the link feature. This has been deprecated for years. instead, use a v2 or v3 docker-compose.yml file (if using compose) or if using a different system, simply put both containers on the same│ so the documentation is out of date. On 9/3/20, Christian Grün wrote: > Hi Nicholas, > > Have you already worked through the Docker documentation in our Wiki [1]? > > Best, > Christian > > [1] https://docs.basex.org/wiki/Docker > > > > > On Thu, Sep 3, 2020 at 4:23 PM Nicholas Saunders > wrote: >> >> I've just opened an issue: >> >> https://github.com/BaseXdb/basex/issues/1936 >> >> based on an inability to run the docker image: >> >> https://devops.stackexchange.com/q/12338/23443 >> >> >> but thought I'd ask here if there might be something obvious. I'm >> creating the container from the hub image with: >> >> docker run -d \ >> --name basexhttp \ >> --publish 1984:1984 \ >> --publish 8984:8984 \ >> --volume "$HOME/basex/data":/srv/basex/data \ >> --volume "$HOME/basex/repo":/srv/basex/repo \ >> --volume "$HOME/basex/webapp":/srv/basex/webapp \ >> basex/basexhttp:latest >> >> >> and another person reported the missing file. Is the file missing? >> I'm not sure. >
Re: [basex-talk] missing web.xml from docker image
thanks. I was able to create the container okay, but how do I connect to the database? What I've done so far is gain root on the container itself and manually copy files in to add to the db. Can I perhaps connect to the db on the container through basex on the host? Or would that be an odd approach? On 9/3/20, Christian Grün wrote: > Thanks for the observation. I’ll try to get into contact with the guys who > wrote the article and see if this can be updated. > > > > Nicholas Saunders schrieb am Fr., 4. Sep. > 2020, 01:19: > >> from what I gather, the link command is deprecated: >> >> it sounds like you are using the link feature. This has been >> deprecated for years. instead, use a v2 or v3 docker-compose.yml >> file (if using compose) or if using a different system, simply put >> both containers on the same│ >> >> so the documentation is out of date. >> >> On 9/3/20, Christian Grün wrote: >> > Hi Nicholas, >> > >> > Have you already worked through the Docker documentation in our Wiki >> > [1]? >> > >> > Best, >> > Christian >> > >> > [1] https://docs.basex.org/wiki/Docker >> > >> > >> > >> > >> > On Thu, Sep 3, 2020 at 4:23 PM Nicholas Saunders >> > wrote: >> >> >> >> I've just opened an issue: >> >> >> >> https://github.com/BaseXdb/basex/issues/1936 >> >> >> >> based on an inability to run the docker image: >> >> >> >> https://devops.stackexchange.com/q/12338/23443 >> >> >> >> >> >> but thought I'd ask here if there might be something obvious. I'm >> >> creating the container from the hub image with: >> >> >> >> docker run -d \ >> >> --name basexhttp \ >> >> --publish 1984:1984 \ >> >> --publish 8984:8984 \ >> >> --volume "$HOME/basex/data":/srv/basex/data \ >> >> --volume "$HOME/basex/repo":/srv/basex/repo \ >> >> --volume "$HOME/basex/webapp":/srv/basex/webapp \ >> >> basex/basexhttp:latest >> >> >> >> >> >> and another person reported the missing file. Is the file missing? >> >> I'm not sure. >> > >> >
[basex-talk] WebDAV username and password
How to authenticate with WebDAV? nicholas $ nicholas $ lynx http://localhost:8984/webdav/ --dump HTTP: Access authorization required. Use the -auth=id:pw parameter. Looking up localhost:8984 Making HTTP connection to localhost:8984 Sending HTTP request. HTTP request sent; waiting for response. Alert!: Access without authorization denied -- retrying lynx: Can't access startfile http://localhost:8984/webdav/ nicholas $ Create a user on the docker container? Change the password for the basex user itself? Or, is this from within the basex console for the container?
Re: [basex-talk] WebDAV username and password
Ah, admin for both. I see. On 9/4/20, Nicholas Saunders wrote: > How to authenticate with WebDAV? > > > nicholas $ > nicholas $ lynx http://localhost:8984/webdav/ --dump > HTTP: Access authorization required. >Use the -auth=id:pw parameter. > > Looking up localhost:8984 > Making HTTP connection to localhost:8984 > Sending HTTP request. > HTTP request sent; waiting for response. > Alert!: Access without authorization denied -- retrying > > lynx: Can't access startfile http://localhost:8984/webdav/ > nicholas $ > > > Create a user on the docker container? Change the password for the > basex user itself? > > Or, is this from within the basex console for the container? >
Re: [basex-talk] missing web.xml from docker image
Certainly, I was able to get the container running. The web.xml threw me off, and then the docs said to use a deprecated command. On 9/4/20, Markus Wittenberg wrote: > Hi there, > > in fact the web.xml is not missing. You should be able to connect to > basex using the exposed ports. This shouldn't be a problem on localhost. > Depending on your system configuration on a server you might have to > provide access to the ports to the web explicitly. > > The REST endpoints /rest/* over port 8984 are also activated by default. > > If you follow the example Running your own Application/DBA in the > documentaton you can also use RESTXQ applications. > > Best regards, > > Markus > > Am 04.09.2020 um 12:11 schrieb Christian Grün: >> …anyone else around here who uses Docker? >> >> On Fri, Sep 4, 2020 at 11:32 AM Nicholas Saunders >> wrote: >>> thanks. I was able to create the container okay, but how do I connect >>> to the database? >>> >>> What I've done so far is gain root on the container itself and >>> manually copy files in to add to the db. Can I perhaps connect to the >>> db on the container through basex on the host? Or would that be an >>> odd approach? >>> >>> On 9/3/20, Christian Grün wrote: >>>> Thanks for the observation. I’ll try to get into contact with the guys >>>> who >>>> wrote the article and see if this can be updated. >>>> >>>> >>>> >>>> Nicholas Saunders schrieb am Fr., 4. Sep. >>>> 2020, 01:19: >>>> >>>>> from what I gather, the link command is deprecated: >>>>> >>>>> it sounds like you are using the link feature. This has been >>>>> deprecated for years. instead, use a v2 or v3 docker-compose.yml >>>>> file (if using compose) or if using a different system, simply put >>>>> both containers on the same│ >>>>> >>>>> so the documentation is out of date. >>>>> >>>>> On 9/3/20, Christian Grün wrote: >>>>>> Hi Nicholas, >>>>>> >>>>>> Have you already worked through the Docker documentation in our Wiki >>>>>> [1]? >>>>>> >>>>>> Best, >>>>>> Christian >>>>>> >>>>>> [1] https://docs.basex.org/wiki/Docker >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Thu, Sep 3, 2020 at 4:23 PM Nicholas Saunders >>>>>> wrote: >>>>>>> I've just opened an issue: >>>>>>> >>>>>>> https://github.com/BaseXdb/basex/issues/1936 >>>>>>> >>>>>>> based on an inability to run the docker image: >>>>>>> >>>>>>> https://devops.stackexchange.com/q/12338/23443 >>>>>>> >>>>>>> >>>>>>> but thought I'd ask here if there might be something obvious. I'm >>>>>>> creating the container from the hub image with: >>>>>>> >>>>>>> docker run -d \ >>>>>>> --name basexhttp \ >>>>>>> --publish 1984:1984 \ >>>>>>> --publish 8984:8984 \ >>>>>>> --volume "$HOME/basex/data":/srv/basex/data \ >>>>>>> --volume "$HOME/basex/repo":/srv/basex/repo \ >>>>>>> --volume "$HOME/basex/webapp":/srv/basex/webapp \ >>>>>>> basex/basexhttp:latest >>>>>>> >>>>>>> >>>>>>> and another person reported the missing file. Is the file missing? >>>>>>> I'm not sure. > > -- > Markus Wittenberg > > Tel +49 (0)341 248 475 36 > Mail wittenb...@axxepta.de > > > > axxepta solutions GmbH > Lehmgrubenweg 17, 88131 Lindau > > Amtsgericht Berlin HRB 97544B > Geschäftsführer: Karsten Becke, Maximilian Gärber > >
Re: [basex-talk] missing web.xml from docker image
There was an additional response: https://devops.stackexchange.com/q/12338/23443 with remarks about the basex docker image which are a bit over my head but should prove useful for the maintainer(s). On 9/4/20, Nicholas Saunders wrote: > Certainly, I was able to get the container running. > > The web.xml threw me off, and then the docs said to use a deprecated > command. > > On 9/4/20, Markus Wittenberg wrote: >> Hi there, >> >> in fact the web.xml is not missing. You should be able to connect to >> basex using the exposed ports. This shouldn't be a problem on localhost. >> Depending on your system configuration on a server you might have to >> provide access to the ports to the web explicitly. >> >> The REST endpoints /rest/* over port 8984 are also activated by default. >> >> If you follow the example Running your own Application/DBA in the >> documentaton you can also use RESTXQ applications. >> >> Best regards, >> >> Markus >> >> Am 04.09.2020 um 12:11 schrieb Christian Grün: >>> …anyone else around here who uses Docker? >>> >>> On Fri, Sep 4, 2020 at 11:32 AM Nicholas Saunders >>> wrote: >>>> thanks. I was able to create the container okay, but how do I connect >>>> to the database? >>>> >>>> What I've done so far is gain root on the container itself and >>>> manually copy files in to add to the db. Can I perhaps connect to the >>>> db on the container through basex on the host? Or would that be an >>>> odd approach? >>>> >>>> On 9/3/20, Christian Grün wrote: >>>>> Thanks for the observation. I’ll try to get into contact with the guys >>>>> who >>>>> wrote the article and see if this can be updated. >>>>> >>>>> >>>>> >>>>> Nicholas Saunders schrieb am Fr., 4. >>>>> Sep. >>>>> 2020, 01:19: >>>>> >>>>>> from what I gather, the link command is deprecated: >>>>>> >>>>>> it sounds like you are using the link feature. This has been >>>>>> deprecated for years. instead, use a v2 or v3 docker-compose.yml >>>>>> file (if using compose) or if using a different system, simply put >>>>>> both containers on the same│ >>>>>> >>>>>> so the documentation is out of date. >>>>>> >>>>>> On 9/3/20, Christian Grün wrote: >>>>>>> Hi Nicholas, >>>>>>> >>>>>>> Have you already worked through the Docker documentation in our Wiki >>>>>>> [1]? >>>>>>> >>>>>>> Best, >>>>>>> Christian >>>>>>> >>>>>>> [1] https://docs.basex.org/wiki/Docker >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Thu, Sep 3, 2020 at 4:23 PM Nicholas Saunders >>>>>>> wrote: >>>>>>>> I've just opened an issue: >>>>>>>> >>>>>>>> https://github.com/BaseXdb/basex/issues/1936 >>>>>>>> >>>>>>>> based on an inability to run the docker image: >>>>>>>> >>>>>>>> https://devops.stackexchange.com/q/12338/23443 >>>>>>>> >>>>>>>> >>>>>>>> but thought I'd ask here if there might be something obvious. I'm >>>>>>>> creating the container from the hub image with: >>>>>>>> >>>>>>>> docker run -d \ >>>>>>>> --name basexhttp \ >>>>>>>> --publish 1984:1984 \ >>>>>>>> --publish 8984:8984 \ >>>>>>>> --volume "$HOME/basex/data":/srv/basex/data \ >>>>>>>> --volume "$HOME/basex/repo":/srv/basex/repo \ >>>>>>>> --volume "$HOME/basex/webapp":/srv/basex/webapp \ >>>>>>>> basex/basexhttp:latest >>>>>>>> >>>>>>>> >>>>>>>> and another person reported the missing file. Is the file missing? >>>>>>>> I'm not sure. >> >> -- >> Markus Wittenberg >> >> Tel +49 (0)341 248 475 36 >> Mail wittenb...@axxepta.de >> >> >> >> axxepta solutions GmbH >> Lehmgrubenweg 17, 88131 Lindau >> >> Amtsgericht Berlin HRB 97544B >> Geschäftsführer: Karsten Becke, Maximilian Gärber >> >> >
[basex-talk] issue: Add custom lib folder #1456
For the Ubuntu install of BaseX, where's the "lib" directory for BaseX? Or, does the Ubuntu build just operate differently? see also: https://askubuntu.com/q/1276967/847449 thanks, Nick
Re: [basex-talk] issue: Add custom lib folder #1456
Hi Christian, that clarifies it, so thanks. Nick On 9/25/20 11:20 AM, Christian Grün wrote: Hi Nick, the Ubuntu distribution contains only the core library. If you want to use all features of BaseX, we recommend you to download the BaseX ZIP archive directly from our homepage. As you may have seen, Kralj Karlo has proposed a new BaseX package for UNIX-based platforms some days ago. This package could possibly be used for a future Ubuntu distribution. Feel free to give it a try and share your feedback with us! Best, Christian On Tue, Sep 22, 2020 at 7:53 PM Nicholas Saunders wrote: For the Ubuntu install of BaseX, where's the "lib" directory for BaseX? Or, does the Ubuntu build just operate differently? see also: https://askubuntu.com/q/1276967/847449 thanks, Nick
[basex-talk] Load xml files to BaseX in a loop
I am new at BaseX so please pardon the newbie question. I am trying to run an xquery script to load a set of xml files in a directory into to BaseX 7.5. If I run replace.xq, shown below, it fails with Out of Main Memory declare %updating function local:upd($path,$file) { db:replace(eams,$path,$file) }; let $files:=for $file in file:list(d:\xmlfiles) return d:\xmlfiles\||$file for $file in $files return local:upd(pd,$file) But if I run file replace.bxs, it updates with no problem commands replace path=p1d:\xmlfiles\drr1.xml/replace replace path=p1d:\xmlfiles\drr2.xml/replace replace path=p1d:\xmlfiles\drr3.xml/replace replace path=p1d:\xmlfiles\dw1.xml/replace replace path=p1d:\xmlfiles\dlp1.xml/replace /commands (The same set of files is being processed by both scripts; I checked) The only idea I have is to use xquery to generate the file replace.bxs and then run it. A better way? Thanks. ___ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
[basex-talk] Java Exception:insertion at beginning of populated table
Via a python client, I am looping through a set of 600 xml files and issuing REPLACE commands to store them in my BaseX db. All was well until I reached file #364, at which point the program crashed with Java.lang.RuntimeException: insertion at beginning of populated table. I am using BaseX 7.7 beta. I guess I shouldn't be using beta? ___ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk