[basex-talk] Access variable database without locking all databases

2019-03-29 Thread Leah Chatkeonopadol
Hi,

I'm using BaseX as a database for a web application with RESTXQ API
endpoints. Each endpoint has a database name specified as a path param, for
example:

declare
%rest:GET
%rest:path('data/{$database}/read')
function readData($database as xs:string) {
let $doc := fn:doc($database || '/data.xml')
return $doc
};

All of the queries inside the function are only run against a single
database, but as described in the transaction management

documentation, using fn:doc with a variable will lock all the databases. Is
there any way around this? Any suggestions would be much appreciated.

Thanks!


Re: [basex-talk] Quick Windows issue: Invalid reply on port 1984, works fine on port 8984

2019-03-29 Thread Jim Salmons
Oops... In my prior message I meant that the basexserver.bat script only starts 
the service on port 1984 not 8984. 

Sorry for the unseen error. BTW, it is the case that when you do the 
basexhttp.bat script on the command-line without the '-S' option, the response 
messages streamed to the command line include a message that the server on 1984 
started along with the http server on 8984. When you invoke this script with 
the '-S' option, only a short message informs you that the server on 8984 has 
started. Perhaps it would be possible to return the message that the server on 
port 1984 started, too?

-: Jim :-

-Original Message-
From: BaseX-Talk  On Behalf Of Jim 
Salmons
Sent: Friday, March 29, 2019 1:16 PM
To: 'Marco Lettere' ; basex-talk@mailman.uni-konstanz.de
Subject: Re: [basex-talk] Quick Windows issue: Invalid reply on port 1984, 
works fine on port 8984

Hi Marco!

Your tip put me on the right track... I have a handle on how things work now 
and, so, I'll share my understanding in hope that it helps another nooby dev, 
especially if under Windows...

CONTEXT: I am pretty sure that my confusion came from working through the 
Startup page of the Getting Started section of the wiki, 
http://docs.basex.org/wiki/Startup. There are a number of different modes for 
running BaseX and each page section gives a tip bullet list of how to invoke 
these modes. Working through the page, both by double-clicking Windows desktop 
icons and issuing batch commands in command prompt and Powershell windows, I 
was inadvertently stopping and starting various combinations of server, http 
server, standalone, etc. And since there were no directly labeled processes or 
services that said anything about BaseX, I was in the dark about what was 
starting, stopping, and running when inspecting Windows' Task Manager.

Given Marco's tip and rereading the bullet points of the wiki's Startup page, I 
now understand "who's on first" in terms of what's running and serving which 
ports. My confusion on Windows was that when you issue the basexserver.bat 
command at a command prompt, you only start the server:8984 while the "BaseX 
Sever (Start)" icon on Windows runs the basexhttp.bat script with the '-S' 
option thus starting BOTH the basic and the http servers (although the 
command-line messages only mention the HTTP server starting on 8984).

I had so many things starting and stopping hither and yon that I was my own 
worst enemy in terms of entry learning.

I now have my "sea legs" and am plowing into the Python API so I can start to 
integrate BaseX with my research toolkit.

Thanks, Marco, for the clarifying tip. :-)

Happy-Healthy Vibes from Colorado,
-: Jim :- 

-Original Message-
From: BaseX-Talk  On Behalf Of 
Marco Lettere
Sent: Friday, March 29, 2019 1:56 AM
To: basex-talk@mailman.uni-konstanz.de
Subject: Re: [basex-talk] Quick Windows issue: Invalid reply on port 1984, 
works fine on port 8984

Hi Jim,

I think port 1984 is not meant to be connected to over HTTP. It's a pure socket 
connection that ships BaseX internal client-server protocol.
When you connect to that port you probably have to use the Python client API in 
order to get your BaseX COMMANDS (not HTTP requests) serialized over the wire.

Hope this helps [cit.].

Regards,
M.

On 28/03/19 23:28, Jim Salmons wrote:
> Hello BaseX folk,
>
> I have just installed version 9.1.2 and am starting to learn BaseX in 
> support of my post-cancer #PayItForward Bonus Round #CitizenScientist 
> research in #DigitalHumanities and #MachineLearning. My goal is to 
> "cut out the middleman" of writing intermediate JSON and XML fragment 
> files in order to update the #MAGAZINEgts ground-truth storage file 
> that I am developing for a digital collection of Softalk Apple magazine at 
> the Internet Archive.
> With BaseX and its Python interface, I want to write new and updated 
> document structure and content depiction metadata directly to a local 
> copy of this ground-truth master file which will then be easily popped 
> out of the database as an XML file for uploading to the Softalk Apple 
> collection at the Internet Archive.
>
> I hit a bump, reported to the Github Issue queue, where my Windows 10 
> installation can not open the BaseX GUI exe launcher. The work-around, 
> as noted in my issue report, is to use the Getting Started advice to 
> execute the jar directly. By creating a desktop icon that launches the 
> execuable jar in the installation folder, the GUI launches as expected.
>
> With that minor issue behind me, I am wondering why my attempts to 
> connect to the server via localhost:1984 port does not work while 
> everything is fine and dandy when hitting port 8984. Port 1984 returns 
> an invalid HTTP response. (Note: Other ports that are not assigned to 
> anything else return a connection refused, so this invalid response is 
> not the same as the server not being there.)
>
> If I keep a Powershell window open wi

Re: [basex-talk] Quick Windows issue: Invalid reply on port 1984, works fine on port 8984

2019-03-29 Thread Jim Salmons
Hi Marco!

Your tip put me on the right track... I have a handle on how things work now 
and, so, I'll share my understanding in hope that it helps another nooby dev, 
especially if under Windows...

CONTEXT: I am pretty sure that my confusion came from working through the 
Startup page of the Getting Started section of the wiki, 
http://docs.basex.org/wiki/Startup. There are a number of different modes for 
running BaseX and each page section gives a tip bullet list of how to invoke 
these modes. Working through the page, both by double-clicking Windows desktop 
icons and issuing batch commands in command prompt and Powershell windows, I 
was inadvertently stopping and starting various combinations of server, http 
server, standalone, etc. And since there were no directly labeled processes or 
services that said anything about BaseX, I was in the dark about what was 
starting, stopping, and running when inspecting Windows' Task Manager.

Given Marco's tip and rereading the bullet points of the wiki's Startup page, I 
now understand "who's on first" in terms of what's running and serving which 
ports. My confusion on Windows was that when you issue the basexserver.bat 
command at a command prompt, you only start the server:8984 while the "BaseX 
Sever (Start)" icon on Windows runs the basexhttp.bat script with the '-S' 
option thus starting BOTH the basic and the http servers (although the 
command-line messages only mention the HTTP server starting on 8984).

I had so many things starting and stopping hither and yon that I was my own 
worst enemy in terms of entry learning.

I now have my "sea legs" and am plowing into the Python API so I can start to 
integrate BaseX with my research toolkit.

Thanks, Marco, for the clarifying tip. :-)

Happy-Healthy Vibes from Colorado,
-: Jim :- 

-Original Message-
From: BaseX-Talk  On Behalf Of 
Marco Lettere
Sent: Friday, March 29, 2019 1:56 AM
To: basex-talk@mailman.uni-konstanz.de
Subject: Re: [basex-talk] Quick Windows issue: Invalid reply on port 1984, 
works fine on port 8984

Hi Jim,

I think port 1984 is not meant to be connected to over HTTP. It's a pure socket 
connection that ships BaseX internal client-server protocol.
When you connect to that port you probably have to use the Python client API in 
order to get your BaseX COMMANDS (not HTTP requests) serialized over the wire.

Hope this helps [cit.].

Regards,
M.

On 28/03/19 23:28, Jim Salmons wrote:
> Hello BaseX folk,
>
> I have just installed version 9.1.2 and am starting to learn BaseX in 
> support of my post-cancer #PayItForward Bonus Round #CitizenScientist 
> research in #DigitalHumanities and #MachineLearning. My goal is to 
> "cut out the middleman" of writing intermediate JSON and XML fragment 
> files in order to update the #MAGAZINEgts ground-truth storage file 
> that I am developing for a digital collection of Softalk Apple magazine at 
> the Internet Archive.
> With BaseX and its Python interface, I want to write new and updated 
> document structure and content depiction metadata directly to a local 
> copy of this ground-truth master file which will then be easily popped 
> out of the database as an XML file for uploading to the Softalk Apple 
> collection at the Internet Archive.
>
> I hit a bump, reported to the Github Issue queue, where my Windows 10 
> installation can not open the BaseX GUI exe launcher. The work-around, 
> as noted in my issue report, is to use the Getting Started advice to 
> execute the jar directly. By creating a desktop icon that launches the 
> execuable jar in the installation folder, the GUI launches as expected.
>
> With that minor issue behind me, I am wondering why my attempts to 
> connect to the server via localhost:1984 port does not work while 
> everything is fine and dandy when hitting port 8984. Port 1984 returns 
> an invalid HTTP response. (Note: Other ports that are not assigned to 
> anything else return a connection refused, so this invalid response is 
> not the same as the server not being there.)
>
> If I keep a Powershell window open with the server running, every once 
> in a while (after several minutes or more) the server throws this error:
>
> java.lang.NullPointerException
>  at org.basex.core.Context.perm(Context.java:252)
>  at org.basex.core.Command.run(Command.java:250)
>  at org.basex.core.Command.run(Command.java:143)
>  at org.basex.core.cmd.Close.close(Close.java:54)
>  at org.basex.server.ClientListener.close(ClientListener.java:232)
>  at org.basex.BaseXServer$1.run(BaseXServer.java:157)
>  at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
>  at java.base/java.util.TimerThread.run(Timer.java:506)
>
> which may be related to port 1984 not responding, a firewall issue perhaps?
> Honestly, I don't see anything that looks like a BaseX process or 
> service running in Task Manager (other than a generic 'Java(TM) Platform SE 
> binar

[basex-talk] Using local xqj

2019-03-29 Thread Gardner, Arthur
Hi!  I've downloaded BaseX 9.2 (Windows distro).

One thing I want to try is the xqj implementation, running locally on the 
server.

I found the class net.xqj.basex.local.BaseXXQDataSource

But when I try getConnection() on an instance of this, I get the following:

java.lang.NoClassDefFoundError: org/basex/core/Proc

I've searched for this class, but without success.

Any ideas out there?

Arthur Gardner | Infosys Ltd
MetLife | Clarks Summit, PA
Office 570-587-6898 | Mobile 262-442-7472


The information contained in this message may be CONFIDENTIAL and is for the 
intended addressee only.  Any unauthorized use, dissemination of the 
information, or copying of this message is prohibited.  If you are not the 
intended addressee, please notify the sender immediately and delete this 
message.


Re: [basex-talk] Quick Windows issue: Invalid reply on port 1984, works fine on port 8984

2019-03-29 Thread Marco Lettere

Hi Jim,

I think port 1984 is not meant to be connected to over HTTP. It's a pure 
socket connection that ships BaseX internal client-server protocol.
When you connect to that port you probably have to use the Python client 
API in order to get your BaseX COMMANDS (not HTTP requests) serialized 
over the wire.


Hope this helps [cit.].

Regards,
M.

On 28/03/19 23:28, Jim Salmons wrote:

Hello BaseX folk,

I have just installed version 9.1.2 and am starting to learn BaseX in
support of my post-cancer #PayItForward Bonus Round #CitizenScientist
research in #DigitalHumanities and #MachineLearning. My goal is to "cut out
the middleman" of writing intermediate JSON and XML fragment files in order
to update the #MAGAZINEgts ground-truth storage file that I am developing
for a digital collection of Softalk Apple magazine at the Internet Archive.
With BaseX and its Python interface, I want to write new and updated
document structure and content depiction metadata directly to a local copy
of this ground-truth master file which will then be easily popped out of the
database as an XML file for uploading to the Softalk Apple collection at the
Internet Archive.

I hit a bump, reported to the Github Issue queue, where my Windows 10
installation can not open the BaseX GUI exe launcher. The work-around, as
noted in my issue report, is to use the Getting Started advice to execute
the jar directly. By creating a desktop icon that launches the execuable jar
in the installation folder, the GUI launches as expected.

With that minor issue behind me, I am wondering why my attempts to connect
to the server via localhost:1984 port does not work while everything is fine
and dandy when hitting port 8984. Port 1984 returns an invalid HTTP
response. (Note: Other ports that are not assigned to anything else return a
connection refused, so this invalid response is not the same as the server
not being there.)

If I keep a Powershell window open with the server running, every once in a
while (after several minutes or more) the server throws this error:

java.lang.NullPointerException
 at org.basex.core.Context.perm(Context.java:252)
 at org.basex.core.Command.run(Command.java:250)
 at org.basex.core.Command.run(Command.java:143)
 at org.basex.core.cmd.Close.close(Close.java:54)
 at org.basex.server.ClientListener.close(ClientListener.java:232)
 at org.basex.BaseXServer$1.run(BaseXServer.java:157)
 at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
 at java.base/java.util.TimerThread.run(Timer.java:506)

which may be related to port 1984 not responding, a firewall issue perhaps?
Honestly, I don't see anything that looks like a BaseX process or service
running in Task Manager (other than a generic 'Java(TM) Platform SE binary'
process, and there is nothing that looks related in the Windows Firewall
entries. I'm still investigating this here, but if anyone knows what is
akimbo, I would greatly appreciate your advice.

Thank you... and looking forward to being a new BaseX community member. :-)

Happy-Healthy Vibes,
-: Jim Salmons :-

 Jim Salmons
     Twitter: @Jim_Salmons

     https://www.researchgate.net/profile/Jim_Salmons (my #CitizenScientist
profile)
 www.medium.com/@Jim_Salmons/ (my mostly #DigitalHumanities writing)