Re: [basex-talk] HTTP headers are all lowercase in responses

2024-06-27 Thread Michael Seiferle
Hi Marco,

I am not 100% sure, whether BaseX or the Java HTTP Client actually does the 
conversion, but it might be due to the fact, that we use the new Java HTTP 
Client since BaseX 10.

By default, it uses HTTP/2 where headers must be lower-case while in versions 
before HTTP/2 the headers are defined to be case-insensitive.
Hence, my guess is:
The conversion happens because it must in HTTP/2 while it’s valid in HTTP/1/1.1.
I hope this doesn’t cause too much trouble on your end.

Best
Michael






Von: BaseX-Talk  im Auftrag von 
Marco Lettere 
Datum: Mittwoch, 26. Juni 2024 um 19:14
An: basex-talk@mailman.uni-konstanz.de 
Betreff: [basex-talk] HTTP headers are all lowercase in responses
Dear all,

just by trying the example of the documentation [1] (at least since
10.4+)  you should be able to verify that the response contains all
headers with lower-case names.

I think a client should not take the freedom to alter HTTP responses if
this is not strictly required. What is the concrete reason for this
behaviour?

hHanks,

Marco.

[1] http:send-request()


Re: [basex-talk] basexgui is crashing for me ...

2024-01-10 Thread Michael Seiferle
Oh that’s unfortunate - I remember struggling to recreate the problem last time 
it was reported and once I got it (not) working, it was a pain to make it work 
again.

I’ll have to check my notes… 
https://mailman.uni-konstanz.de/pipermail/basex-talk/2023-October/018153.html
…so,
I think I had to remove everything; Jdk and BaseX. Afterwards I set my security 
preferences to “allow apps from App Store and trusted developers” and 
reinstalled openjdk and BaseX.  Bit of a pain!


I hope maybe this does the trick for you as well.

Best,

Michael


Am 10.01.2024 um 19:41 schrieb Jonathan Robie :


I should have included this:

 % java --version
openjdk 21.0.1 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode)

% basexgui
2024-01-10 13:40:21.624 java[56086:5869820] WARNING: Secure coding is 
automatically enabled for restorable state! However, not on all supported macOS 
versions of this application. Opt-in to secure coding explicitly by 
implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x7ff80e07cb73, pid=56086, tid=259
#
# JRE version: OpenJDK Runtime Environment Homebrew (21.0.1) (build 21.0.1)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (21.0.1, mixed mode, sharing, 
tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [AppKit+0xc8fb73]  _NSCarbonMenuCrashIfNeeded+0x258
#
# Core dump will be written. Default location: /cores/core.56086
#
# An error report file with more information is saved as:
# /Users/jonathan/github/Clear/hs_err_pid56086.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/Homebrew/homebrew-core/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
zsh: abort  basexgui

On Wed, Jan 10, 2024 at 1:30 PM Jonathan Robie 
mailto:jonathan.ro...@gmail.com>> wrote:
Sigh - I just did that, it still crashes ...

Jonathan

On Wed, Jan 10, 2024 at 1:22 PM Jonathan Robie 
mailto:jonathan.ro...@gmail.com>> wrote:
Thanks for the prompt, helpful response!

Jonathan

On Wed, Jan 10, 2024 at 5:54 AM Christian Grün 
mailto:christian.gr...@gmail.com>> wrote:
Hi Jonathan,

This problem is related to Homebrew and Apple [1], and does not seem to be 
solved yet.

There are alternatives, though. One solution that has been suggested by my 
colleague Michael is to:

1. Uninstall the homebrew openjdk:
   brew uninstall openjdk --ignore-dependencies
2. Manual install Adoptium Open JDK (11 or later):
https://adoptium.net:

See [2] for further information.

Hope this helps,
Christian

[1] https://github.com/Homebrew/homebrew-core/issues/150824
[2] 
https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg15457.html



On Tue, Jan 9, 2024 at 9:17 PM Jonathan Robie 
mailto:jonathan.ro...@gmail.com>> wrote:
Basexgui has been crashing for me.

I thought my environment might be messed up, so I uninstalled brew, reinstalled 
it, and checked my environment.

Then I ran basexgui, and got another crash.

% basexgui
2024-01-09 15:09:58.791 java[18502:5023580] WARNING: Secure coding is 
automatically enabled for restorable state! However, not on all supported macOS 
versions of this application. Opt-in to secure coding explicitly by 
implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x7ff80e07cb73, pid=18502, tid=259
#
# JRE version: OpenJDK Runtime Environment Homebrew (21.0.1) (build 21.0.1)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (21.0.1, mixed mode, sharing, 
tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [AppKit+0xc8fb73]  _NSCarbonMenuCrashIfNeeded+0x258
#
# Core dump will be written. Default location: /cores/core.18502
#
# An error report file with more information is saved as:
# /Users/jonathan/github/Clear/hs_err_pid18502.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/Homebrew/homebrew-core/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
zsh: abort  basexgui

What should I do?

Jonathan


Re: [basex-talk] fiddle certificate error

2024-01-09 Thread Michael Seiferle
Hi Martin,

Sorry my bad, seems like I forgot to activate auto-renewal with our certificate 
issuer.

Thanks for reporting this 

Best
Michael

Von: BaseX-Talk  im Auftrag von 
Martin Honnen 
Datum: Dienstag, 9. Januar 2024 um 12:41
An: basex-talk@mailman.uni-konstanz.de 
Betreff: [basex-talk] fiddle certificate error

Hi,

trying to access https://bxfiddle.cloud.basexgmbh.de/ Chrome tells me

Your connection is not private
Attackers might be trying to steal your information from
bxfiddle.cloud.basexgmbh.de (for example, passwords, messages, or credit
cards). Learn more
NET::ERR_CERT_DATE_INVALID

bxfiddle.cloud.basexgmbh.de normally uses encryption to protect your
information. When Chrome tried to connect to bxfiddle.cloud.basexgmbh.de
this time, the website sent back unusual and incorrect credentials. This
may happen when an attacker is trying to pretend to be
bxfiddle.cloud.basexgmbh.de, or a Wi-Fi sign-in screen has interrupted
the connection. Your information is still secure because Chrome stopped
the connection before any data was exchanged.

You cannot visit bxfiddle.cloud.basexgmbh.de right now because the
website uses HSTS. Network errors and attacks are usually temporary, so
this page will probably work later.


It seems the certificate expired on Jan 2nd of this (new) year.

Anyone can fix this?




Re: [basex-talk] Crash when starting basexgui

2023-10-25 Thread Michael Seiferle
Hi Johan,
Hi Joe,

ok so I made it work again:
I uninstalled the homebrew openjdk:
brew uninstal openjdk --ignore-dependencies
I manually installed: https://adoptium.net
Eclipse Temurin™  Open JDK Version 21.0.1, and it is working again.

Maybe this works for you as well, seems like a pretty annoying issue to say the 
least.



All the best :-)
Michael


Am 25.10.2023 um 14:21 schrieb Michael Seiferle :

Hi Johan,

it works (well worked… see below) on my machine with the very same setup 
(basex@10.7 & openjdk@21 via brew, see my previous email), so I am sure it is 
an issue for certain setups.


  1.  what’s your security settings? Apple Menu -> Privacy & Security -> Allow 
Applications Downloaded from… mine is set to “App Store and identified 
developers”.
  2.  Now if I set it to “App Store” BaseX will not start with the following 
error:



BUT: now it won’t start again even if I set it back :-{
So my motivation to find a fix or workaround is considerably higher now  I 
will report once I found something.

The warning that is dumped to your console — something something 
NSApplicationDelegate.applicationSupportsSecureRestorableState — doesn’t cause 
BaseX to crash, as I could see this warning as well.
Background:
https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate

Best
Michael


Von: Christian Grün 
Datum: Mittwoch, 25. Oktober 2023 um 13:09
An: Johan Mörén 
Cc: Michael Seiferle , BaseX 

Betreff: Re: [basex-talk] Crash when starting basexgui
Thanks. It seems we have to wait for Apple to fix this. Unfortunately, their 
bug tracker doesn’t seem to be public [2].

[1] 
https://github.com/Homebrew/homebrew-core/issues/150824#issuecomment-1776139189


On Wed, Oct 25, 2023 at 1:01 PM Johan Mörén 
mailto:johan.mo...@gmail.com>> wrote:
Running MacOS Sonoma Apple Silicon M2 processor and ran into the same problem 
when homebrew updated my JDK to 21.0.1 today.

According to this article it seems like applications like jmeter and IntelliJ 
needs to fix this by implementing a specific interface. I guess this applies to 
Basexgui as well?

https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate

Regards,
Johan



Re: [basex-talk] Crash when starting basexgui

2023-10-24 Thread Michael Seiferle
…as  others seem to experience this as well with i.e. jemeter, regardless of 
intel/arm — maybe this workaround can be of help?

https://github.com/apache/jmeter/issues/6083#issuecomment-1765484046


Best
Michael

Von: BaseX-Talk  im Auftrag von 
Michael Seiferle 
Datum: Dienstag, 24. Oktober 2023 um 16:13
An: Joe Wicentowski 
Cc: BaseX 
Betreff: Re: [basex-talk] Crash when starting basexgui
Hi Joe,

Unfortunately, I am unable to reproduce this behavior — I am running the 
following:

❯  brew install basex openjdk
Warning: basex 10.7 is already installed and up-to-date.
To reinstall 10.7, run:
  brew reinstall basex
Warning: openjdk 21 is already installed and up-to-date.
To reinstall 21, run:
  brew reinstall openjdk

❯ java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment Homebrew (build 21)
OpenJDK 64-Bit Server VM Homebrew (build 21, mixed mode, sharing)

Which seems to be identical to your version, the only detail different, seems 
to be that you are on x86_64 while I am running arm.

I also tried to install openjdk 17 — this seemed to work as well, maybe you 
could see if the behavior is any different with 17:

bash-3.2$ brew install openjdk@17
bash-3.2$ export JAVA_HOME=`/usr/libexec/java_home -v 17`
bash-3.2$ java -version
openjdk version "17.0.7" 2023-04-18 LTS
bash-3.2$ basexgui

Maybe someone else running Sonoma on Intel might be able to share their 
experiences; my remaining Intel Mac will not run Sonoma.


Best
Michael


Am 24.10.2023 um 14:28 schrieb Michael Seiferle :

Dear Joe,

Thanks for the report,I haven’t upgraded to Sonoma yet, but will this afternoon 
:)

I will try to reproduce the error and come back to the list. :-)


Best
Michael

Am 24.10.2023 um 13:40 schrieb Joe Wicentowski :

Hi all,

I am experiencing a crash when starting basexgui. The splash screen appears 
briefly, and then the message pasted in below appears, and I've also attached 
the referenced error report file and the crash report that appears in the Mac 
crash dialog. I'm using BaseX 10.7, installed via Homebrew (which installed 
BaseX's openjdk dependency and thus is using openjdk 21), on macOS Sonoma 
(14.0).

I'd be happy to provide any other info that would help in identifying the cause 
of the crash.

Joe


% basexgui
2023-10-24 07:34:22.308 java[69449:3862142] WARNING: Secure coding is 
automatically enabled for restorable state! However, not on all supported macOS 
versions of this application. Opt-in to secure coding explicitly by 
implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x7ff80d2b1b73, pid=69449, tid=259
#
# JRE version: OpenJDK Runtime Environment Homebrew (21.0) (build 21)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (21, mixed mode, sharing, tiered, 
compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [AppKit+0xc8fb73]  _NSCarbonMenuCrashIfNeeded+0x258
#
# No core dump will be written. Core dumps have been disabled. To enable core 
dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/joe/workspace/hsg-project/repos/hsg-shell/hs_err_pid69449.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/Homebrew/homebrew-core/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
zsh: abort  basexgui







Re: [basex-talk] Crash when starting basexgui

2023-10-24 Thread Michael Seiferle
Hi Joe,

Unfortunately, I am unable to reproduce this behavior — I am running the 
following:

❯  brew install basex openjdk
Warning: basex 10.7 is already installed and up-to-date.
To reinstall 10.7, run:
  brew reinstall basex
Warning: openjdk 21 is already installed and up-to-date.
To reinstall 21, run:
  brew reinstall openjdk

❯ java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment Homebrew (build 21)
OpenJDK 64-Bit Server VM Homebrew (build 21, mixed mode, sharing)

Which seems to be identical to your version, the only detail different, seems 
to be that you are on x86_64 while I am running arm.

I also tried to install openjdk 17 — this seemed to work as well, maybe you 
could see if the behavior is any different with 17:

bash-3.2$ brew install openjdk@17
bash-3.2$ export JAVA_HOME=`/usr/libexec/java_home -v 17`
bash-3.2$ java -version
openjdk version "17.0.7" 2023-04-18 LTS
bash-3.2$ basexgui

Maybe someone else running Sonoma on Intel might be able to share their 
experiences; my remaining Intel Mac will not run Sonoma.


Best
Michael

Am 24.10.2023 um 14:28 schrieb Michael Seiferle :

Dear Joe,

Thanks for the report,I haven’t upgraded to Sonoma yet, but will this afternoon 
:)

I will try to reproduce the error and come back to the list. :-)


Best
Michael

Am 24.10.2023 um 13:40 schrieb Joe Wicentowski :


Hi all,

I am experiencing a crash when starting basexgui. The splash screen appears 
briefly, and then the message pasted in below appears, and I've also attached 
the referenced error report file and the crash report that appears in the Mac 
crash dialog. I'm using BaseX 10.7, installed via Homebrew (which installed 
BaseX's openjdk dependency and thus is using openjdk 21), on macOS Sonoma 
(14.0).

I'd be happy to provide any other info that would help in identifying the cause 
of the crash.

Joe


% basexgui
2023-10-24 07:34:22.308 java[69449:3862142] WARNING: Secure coding is 
automatically enabled for restorable state! However, not on all supported macOS 
versions of this application. Opt-in to secure coding explicitly by 
implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x7ff80d2b1b73, pid=69449, tid=259
#
# JRE version: OpenJDK Runtime Environment Homebrew (21.0) (build 21)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (21, mixed mode, sharing, tiered, 
compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [AppKit+0xc8fb73]  _NSCarbonMenuCrashIfNeeded+0x258
#
# No core dump will be written. Core dumps have been disabled. To enable core 
dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/joe/workspace/hsg-project/repos/hsg-shell/hs_err_pid69449.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/Homebrew/homebrew-core/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
zsh: abort  basexgui







Re: [basex-talk] Crash when starting basexgui

2023-10-24 Thread Michael Seiferle
Dear Joe,

Thanks for the report,I haven’t upgraded to Sonoma yet, but will this afternoon 
:)

I will try to reproduce the error and come back to the list. :-)


Best
Michael

Am 24.10.2023 um 13:40 schrieb Joe Wicentowski :


Hi all,

I am experiencing a crash when starting basexgui. The splash screen appears 
briefly, and then the message pasted in below appears, and I've also attached 
the referenced error report file and the crash report that appears in the Mac 
crash dialog. I'm using BaseX 10.7, installed via Homebrew (which installed 
BaseX's openjdk dependency and thus is using openjdk 21), on macOS Sonoma 
(14.0).

I'd be happy to provide any other info that would help in identifying the cause 
of the crash.

Joe


% basexgui
2023-10-24 07:34:22.308 java[69449:3862142] WARNING: Secure coding is 
automatically enabled for restorable state! However, not on all supported macOS 
versions of this application. Opt-in to secure coding explicitly by 
implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x7ff80d2b1b73, pid=69449, tid=259
#
# JRE version: OpenJDK Runtime Environment Homebrew (21.0) (build 21)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (21, mixed mode, sharing, tiered, 
compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [AppKit+0xc8fb73]  _NSCarbonMenuCrashIfNeeded+0x258
#
# No core dump will be written. Core dumps have been disabled. To enable core 
dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/joe/workspace/hsg-project/repos/hsg-shell/hs_err_pid69449.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/Homebrew/homebrew-core/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
zsh: abort  basexgui






Re: [basex-talk] Access denied using client

2023-10-21 Thread Michael Seiferle
Hey Csaba,

good to hear that :-)

Have a nice weekend,

Michael


Von meinem iPhone gesendet

Am 21.10.2023 um 08:09 schrieb Csaba Fekete :


Hi Michael
I was about to send the Dockerfile to you when I realized what the problem was!
I did not attach a volume to the container. For this reason, whenever I 
restarted the container, data - along with the new password I guess - was lost.
Adding this to docker-compose.yml solved it:
volumes:
  - "./docker/basex/data:/opt/basex/data"
Thank you guys!
Cheers

On Fri, 20 Oct 2023 at 23:35, Michael Seiferle 
mailto:m...@basex.org>> wrote:
Hey Csaba,

Feel free to post your Dockerfile, I’ll have a look at it tomorrow :-)
Maybe I’ll spot something :-)

Best
Michael

Von meinem iPhone gesendet

Am 20.10.2023 um 22:15 schrieb Csaba Fekete 
mailto:feketecs...@gmail.com>>:


Sorry, please ignore, it still doesn't work.
It works on my local machine, but not in the Docker container.
It looks like my Dockerfile is not quite right yet.
I'll keep trying. Thanks anyway.


On Fri, 20 Oct 2023 at 22:04, Csaba Fekete 
mailto:feketecs...@gmail.com>> wrote:
Szia Christian :-)
Yeah, I've tried restarting the server.
And this time I tried running the server as root and now it works fine! So it 
looks like the problem was that I had created a non-root user (basex) to run 
the server (I thought it would be safer when this gets deployed to a real 
server later).
Many thanks for your help!
Csaba

On Fri, 20 Oct 2023 at 21:56, Christian Grün 
mailto:christian.gr...@gmail.com>> wrote:
Szia Csaba,

Thanks for your observation. You may need to set the password first, and start 
the server after that.

Does this help?
Christian



Csaba Fekete mailto:feketecs...@gmail.com>> schrieb am 
Fr., 20. Okt. 2023, 21:40:
Hello,

A total newbie here, I'm a first time user.
I have installed basex on Ubuntu and I'm running the server attached to 
127.0.0.1, on port 1984. It looks like this is working and the server is 
listening.
Now I create a password for admin:

basex@cac5ba21e248:/opt/basex/bin$ ./basex
BaseX 10.8 beta [Standalone]
Try 'help' to get more information.
> PASSWORD xxx
Password of user 'admin' changed.

Now I'm trying to connect using the client:

basex@cac5ba21e248:/opt/basex/bin$ ./basexclient -n127.0.0.1 -p1984 -Uadmin 
-Pxxx
Access denied: admin.

The server log confirms the same:

basex@cac5ba21e248:~/basex/.logs$ cat 2023-10-20.log
18:51:30.575 SERVER admin OK Server was started (port: 1984).
18:51:42.316 172.22.0.1:41314<http://172.22.0.1:41314> admin ERROR Access 
denied: admin. 30.7 ms
18:53:04.079 172.22.0.1:59892<http://172.22.0.1:59892> admin ERROR Access 
denied: admin. 23.59 ms

What am I missing?
Thanks and regards

PS. I'm doing this inside a docker container if that matters.




Re: [basex-talk] Access denied using client

2023-10-20 Thread Michael Seiferle
Hey Csaba,

Feel free to post your Dockerfile, I’ll have a look at it tomorrow :-)
Maybe I’ll spot something :-)

Best
Michael

Von meinem iPhone gesendet

Am 20.10.2023 um 22:15 schrieb Csaba Fekete :


Sorry, please ignore, it still doesn't work.
It works on my local machine, but not in the Docker container.
It looks like my Dockerfile is not quite right yet.
I'll keep trying. Thanks anyway.


On Fri, 20 Oct 2023 at 22:04, Csaba Fekete 
mailto:feketecs...@gmail.com>> wrote:
Szia Christian :-)
Yeah, I've tried restarting the server.
And this time I tried running the server as root and now it works fine! So it 
looks like the problem was that I had created a non-root user (basex) to run 
the server (I thought it would be safer when this gets deployed to a real 
server later).
Many thanks for your help!
Csaba

On Fri, 20 Oct 2023 at 21:56, Christian Grün 
mailto:christian.gr...@gmail.com>> wrote:
Szia Csaba,

Thanks for your observation. You may need to set the password first, and start 
the server after that.

Does this help?
Christian



Csaba Fekete mailto:feketecs...@gmail.com>> schrieb am 
Fr., 20. Okt. 2023, 21:40:
Hello,

A total newbie here, I'm a first time user.
I have installed basex on Ubuntu and I'm running the server attached to 
127.0.0.1, on port 1984. It looks like this is working and the server is 
listening.
Now I create a password for admin:

basex@cac5ba21e248:/opt/basex/bin$ ./basex
BaseX 10.8 beta [Standalone]
Try 'help' to get more information.
> PASSWORD xxx
Password of user 'admin' changed.

Now I'm trying to connect using the client:

basex@cac5ba21e248:/opt/basex/bin$ ./basexclient -n127.0.0.1 -p1984 -Uadmin 
-Pxxx
Access denied: admin.

The server log confirms the same:

basex@cac5ba21e248:~/basex/.logs$ cat 2023-10-20.log
18:51:30.575 SERVER admin OK Server was started (port: 1984).
18:51:42.316 172.22.0.1:41314 admin ERROR Access 
denied: admin. 30.7 ms
18:53:04.079 172.22.0.1:59892 admin ERROR Access 
denied: admin. 23.59 ms

What am I missing?
Thanks and regards

PS. I'm doing this inside a docker container if that matters.




Re: [basex-talk] GUI doesn't quit on Mac

2022-11-09 Thread Michael Seiferle
Hi Joe,
Hi list,

I remember having a shared screen-screen-session with Christian not too long 
ago, where we tried to pin down the issue and iirc “it worked back then” — but 
obviously not for too long. It’s a rather odd behavior

I fully agree with Joe, whether we click that little X or select Quit from the 
menu bar, the app should fully close.

We are looking into this again :-)

You may follow my progress here: https://github.com/BaseXdb/basex/pull/2149

Best

Michael


Von: BaseX-Talk  im Auftrag von Joe 
Wicentowski 
Datum: Mittwoch, 9. November 2022 um 01:21
An: Majewski, Steven Dennis (sdm7g) 
Cc: BaseX 
Betreff: Re: [basex-talk] GUI doesn't quit on Mac
As a Mac user, I do not generally expect closing a window via the red window 
button to quit an app. With only a few exceptions (e.g., single window only 
apps like the Calculator), closing any/all of an app's windows will keep the 
app open; apps that remain open after their windows are closed generally take a 
click on the app's Dock icon as a signal to open a new window.

But I do expect that selecting Quit via the menu bar will fully quit the app. 
Respecting that Quit command is far more important than treating the red window 
button as a request to Quit.

A few times I've needed to restart my Mac to install a software update or 
finish installing a piece of software. Typically, these processes present the 
user with a dialog to trigger the restart, which, when accepted, causes the OS 
to quit all open apps. In this scenario, BaseX causes the restart to fail, 
because it will not quit when told, and the restart will time out unless you 
find out how to quit it. (I use control-C in the Terminal window where I ran 
the `basexgui` command.)

I hope this sheds some light on the matter. Thanks!

On Tue, Nov 8, 2022 at 3:11 PM Majewski, Steven Dennis (sdm7g) 
mailto:sd...@virginia.edu>> wrote:
It looks like it does exit, after a short delay, when closed by clicking the 
red button on the window, instead of quoting from the menu.

— Steve.



On Nov 8, 2022, at 3:04 PM, Christian Grün 
mailto:christian.gr...@gmail.com>> wrote:

Thanks for the observation. Mac support was improved in general with Java 11, 
but it still requires some OS-specific tweaks in the code. Our current solution 
may not be complete enough to achieve the expected default behavior [1].

I’m no Mac user, but does it make a difference if the GUI is quit a) via the 
menu or b) the red icon?

[1] 
https://github.com/BaseXdb/basex/blob/main/basex-core/src/main/java/org/basex/gui/layout/BaseXLayout.java#L584


Joe Wicentowski mailto:joe...@gmail.com>> schrieb am Di., 8. 
Nov. 2022, 20:54:
I've been experiencing this problem too on macOS (both 12 Monterey and now 13 
Ventura), installed via Homebrew, and started via the `basexgui` command line 
command.

On Tue, Nov 8, 2022 at 1:02 PM Majewski, Steven Dennis (sdm7g) 
mailto:sd...@virginia.edu>> wrote:
I’ve been having a problem for a while where after attempting to quit the Mac 
GUI, it doesn’t actually exit and has to be force quit. I’m sorry I wasn’t able 
to track how this tracks with MacOS / JDK / BaseX updates and when it actually 
started happening. Wondering if anyone else has had this issue, and whether 
it’s Mac specific or JDK version specific.


MacOS 12.6.1 but problem goes back at least to earlier 12.6 versions
Openjdk from home-brew install — currently openjdk/19.0.1, but was happening on 
earlier versions.
And the current and last several versions of BaseX


— Steve M.







Re: [basex-talk] BaseX YAML Parser?

2022-07-29 Thread Michael Seiferle
Hi Adam,
Hi List,

thanks for pointing out the XQuery implementation, I think it should run just 
fine in BaseX — yet it is very limited w.r.t. to yml features but might be good 
start to further refine 

I found  another pragmatic way, that might be useful to some:
https://git.basex.io/-/snippets/117

If you can rely on an external tool:
`yq`[1] which integrates an XML output mode, the results might be easy to 
process.

let $yml := ``[
---
# An employee record
name: Martin D'vloper
job: Developer
skill: foo
employed: True
foods:
  - Apple
  - Orange
  - Strawberry
  - Mango
languages:
  perl: Elite
  python: Elite
  pascal: Lame
education: |
  4 GCSEs
  3 A-Levels
  BSc in the Internet of Things
]``
return (

  element yaml {
proc:system("yq", ("-o","xml"), map{"input":$yml})
=> parse-xml-fragment()
  }
)

Best
Michael

[1] https://github.com/mikefarah/yq

Von: BaseX-Talk  im Auftrag von 
Adam Law 
Datum: Freitag, 29. Juli 2022 um 09:27
An: BaseX 
Betreff: Re: [basex-talk] BaseX YAML Parser?
Perhaps you have already seen:
https://gist.github.com/joewiz/ed624a43cb6f9e15cc44b6e30553ad5e
I think it might be for ExistDB

On Wed, Jul 27, 2022 at 6:00 PM 
mailto:basex-talk-requ...@mailman.uni-konstanz.de>>
 wrote:
Send BaseX-Talk mailing list submissions to

basex-talk@mailman.uni-konstanz.de

To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
or, via email, send a message with subject or body 'help' to

basex-talk-requ...@mailman.uni-konstanz.de

You can reach the person managing the list at

basex-talk-ow...@mailman.uni-konstanz.de

When replying, please edit your Subject line so it is more specific
than "Re: Contents of BaseX-Talk digest..."


Today's Topics:

   1. Re: Fwd: Available Integration with Apache POI for Excel
  Generation? (Eliot Kimber)
   2. BaseX YAML Parser? (Eliot Kimber)
   3. Re: BaseX YAML Parser? (Marco Lettere)
   4. Re: BaseX YAML Parser? (Martin Honnen)
   5. Re: BaseX YAML Parser? (Hans-Juergen Rennau)
   6. Re: BaseX YAML Parser? (?yvind Gjesdal)
   7. Re: BaseX YAML Parser? (Imsieke, Gerrit, le-tex)
   8. Re: BaseX YAML Parser? (Eliot Kimber)


--

Message: 1
Date: Tue, 26 Jul 2022 13:08:24 +
From: Eliot Kimber 
mailto:eliot.kim...@servicenow.com>>
To: BaseX 
mailto:basex-talk@mailman.uni-konstanz.de>>
Subject: Re: [basex-talk] Fwd: Available Integration with Apache POI
for Excel Generation?
Message-ID:

mailto:sn4pr0801mb77576bad6b0f077d6727731cf1...@sn4pr0801mb7757.namprd08.prod.outlook.com>>

Content-Type: text/plain; charset="windows-1252"

Tim,

Thanks for the pointer?that?s not quite what I was looking for.

What I have in mind is adding functions that let you read and write Excel 
spreadsheets using the POI API, which is much easier to use than interacting 
directly with the OOXML under the covers (Excel uses a lot of indirection and 
data normalization to minimize file size that makes operating on the raw XML 
really challenging).

I fully understand that Christian?s team have done this kind of work for hire 
and are not keen (or even contractually allowed) to give it away. It?s valuable 
stuff.

But I had to ask?

Cheers,

E.

_
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com
LinkedIn | 
Twitter | 
YouTube | 
Facebook

From: BaseX-Talk 
mailto:basex-talk-boun...@mailman.uni-konstanz.de>>
 on behalf of Tim Thompson mailto:timat...@gmail.com>>
Date: Monday, July 25, 2022 at 5:50 PM
To: BaseX 
mailto:basex-talk@mailman.uni-konstanz.de>>
Subject: [basex-talk] Fwd: Available Integration with Apache POI for Excel 
Generation?
[External Email]

Resending to the list (forgot to reply all).

-- Forwarded message -
From: Tim Thompson 
mailto:timat...@gmail.com>>>
Date: Mon, Jul 25, 2022 at 5:04 PM
Subject: Re: [basex-talk] Available Integration with Apache POI for Excel 
Generation?
To: Eliot Kimber 
mailto:eliot.kim...@servicenow.com>>>

Hi, Eliot,

I'm not aware of any integration with Apache POI (which would be great), but 
here's a project--it seems unfinished, but may be enough to get started with?


Re: [basex-talk] Constructing and querying map structures in a dynamic way

2022-05-25 Thread Michael Seiferle
Hi Markus,

The standard specification just shows examples for topics like “days”
and “books” with map constructors based on literal data.

If you are looking for functions to construct maps dynamically, maybe map:merge 
& map:entry are what you are after?

map:merge(
  for $i at $pos in 1 to 10
  return map:entry($i, $i*$i)
)


Best
Michael

Von: BaseX-Talk  im Auftrag von 
Markus Elfring 
Datum: Mittwoch, 25. Mai 2022 um 17:35
An: Graydon Saunders 
Cc: basex-talk@mailman.uni-konstanz.de 
Betreff: Re: [basex-talk] Constructing and querying map structures in a dynamic 
way
> Maps are a derivative of the function type and highly general.

I got informed that the data structure “map” got a clear meaning according to
XQuery programming interfaces.



> You're in effect asking for examples of using a function with no other
> information provided.

I came along another clarification desire according to the mentioned standard
data structure.


> It's just about impossible to answer usefully.

The standard specification just shows examples for topics like “days”
and “books” with map constructors based on literal data.
How would the XQuery code look like if a detailed FLWOR expression would
be applied instead?

The subsequent CSV result output should show finally that keys and associated
values were properly determined before.

Regards,
Markus


Re: [basex-talk] ODBC support for BaseX?

2022-05-20 Thread Michael Seiferle
Hi Markus,
Hi Martin,

as both JDBC and ODBC are SQL based or at least tailored for the relational 
database model (for all I know) I think it would be tedious to implement 
something that complies with those standards.
And in the end, probably not very useful per-se, as we have XQuery for querying 
XML and while I like SQL for relational data I could not imagine me using it to 
query complex XML structures.

For the sake of completeness: there is a standard, XQJ, that is neither widely 
used nor under active maintenance http://xqj.net/ and only Supports XQuery 1.0. 
I don’t think you would want to use that.

I think a more modern and more document-resource-oriented approach to a 
standard API might be the https://de.wikipedia.org/wiki/Open_Data_Protocol and 
I once or twice thought about implanting it with RestXQ but I guess this would 
be full-time job 


Maybe I am missing the point, so it would be interesting to know more about 
your motivation  

Best
Michael


Von: BaseX-Talk  im Auftrag von 
Markus Elfring 
Datum: Freitag, 20. Mai 2022 um 12:28
An: Martin Honnen , basex-talk@mailman.uni-konstanz.de 

Betreff: Re: [basex-talk] ODBC support for BaseX?
> > Is any support available for data management by interfaces like the 
> > following?
> >
> > * Open Database Connectivity
> > * Java Database Connectivity
>
> Are you just looking for https://docs.basex.org/wiki/SQL_Module?

No. (Not for related use cases at the moment.)

This module is useful for accessing relational databases from XQuery using SQL.

I became curious also for data exchange in the other direction
according to such a programming interface.
Can any BaseX databases be represented as ODBC (or JDBC) data sources?

Regards,
Markus


Re: [basex-talk] BaseX, RESTXQ, and React?

2022-05-20 Thread Michael Seiferle
Dear Eliot,

I cannot speak for React directly, yet we have had excellent results when using 
vuejs or Vanilla JS + RestXQ.
For all projects involving any sort of HTML frontend, our approach is twofold:

We provide RestXQ Endpoints, usually authentication is handled via the session 
module, or in more advanced cases using JWT-Auth-Tokens or a combination of 
both.
For simple scenarios we then have our BaseX-Jetty-Server serve the static 
files, i.e. our HTML + JS Code directly from the filesystem, if it gets more 
complex we can outsource the web app to nginx for example.

I then map the default servlet to “/” — so files from ./webapp will be served 
at http://localhost:8984/
I then map the RESTXQ-servlet to “/api” — so calls to these endpoints will be 
served by RestXQ.

I set up a simple project here outlining this structure 
https://git.basex.io/ms/ml-example-webapp — everything is served from BaseX and 
the project is pretty self-contained.

I would not, however, serve the HTML and JS Contents via RestXQ endpoints — 
while technically possible you might probably use a lot of tooling support that 
works on plain HTML & JS(X) files and people not familiar with embedding HTML 
in XQuery Module or functions will likely lose their minds over the inexistence 
of named entities or escaping of curly braces 
Plus: should you ever decide to ditch RestXQ and use another API (not 
recommended) you could do that more easily.

Hope this is useful to you.

Best
Michael

Von: BaseX-Talk  im Auftrag von 
Eliot Kimber 
Datum: Freitag, 20. Mai 2022 um 00:18
An: basex-talk@mailman.uni-konstanz.de 
Betreff: [basex-talk] BaseX, RESTXQ, and React?
I’m starting to learn React in the context of enhancing a React-based site 
created by others (lightstep.com/incident-reponse/docs).

I’m also developing a non-trivial web application in BaseX (the Project Mirabel 
system I’ve mentioned before).

For Mirabel I just hacked some pages using RESTXQ and the least CSS and 
JavaScript I could get away with, cribbing liberally from the out-of-the-box 
BaseX web apps.

But as I learn about React and its companion, Material UI, I’m thinking that 
there’s probably a lot of power to combining React with RESTXQ as a way to 
build a top-notch site with lots of interactivity at relatively low cost (React 
and MUI provide all the interaction implementation details you might want). But 
I’m not sure what this would mean in practice.

I’m wondering if anyone else has done this or at least thought about it enough 
to have some ideas about what to do or not do?

In addition, at the most recent DITA conference, Convex 2022, George Bina 
presented a very interesting experiment in generating React components for DITA 
topics where the components did the dynamic content resolution at delivery time 
rather than at HTML building time, enabling practical incremental update of 
DITA-based content through a React-based site. The same technique could be 
applied to RESTXQ by generating XQuery modules for individual topics. But an 
advantage of a React approach is that it’s more general and could be used with 
any React-based site. But in any case it’s gotten me thinking more about the 
generation of information

I see React being used mostly in statically-generated sites that are published 
through something like Netlify but my Mirabel application is very much almost 
entirely dynamic in that most of the content is the result of queries.

One could treat BaseX as a supplier of microservices via a REST API and that’s 
probably how most users of BaseX with React do it, if for no other reason than 
separate groups are probably responsible for the web stuff and the BaseX stuff.

But in the case of my Mirabel application it’s a single team doing everything 
with limited web development knowledge but access to talented web designers. So 
having all the web stuff also in BaseX makes development and maintenance easier 
with the team we have. We’re not JavaScript programmers but we can manage 
composing React components together and doing the minimal programming needed to 
make them behave appropriately.

Clearly I can just have RESTXQ-generated pages import the React libraries and 
supporting components directly and I can generate JSX code as inline scripting 
and maybe that’s the best approach for an all-RESTXQ site but maybe there’s 
something better?

Or does stepping up to a proper React site that uses BaseX as a source of 
microservices make more sense, even for this small project?

Thanks,

Eliot
_
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com
LinkedIn | 
Twitter | 
YouTube | 
Facebook


Re: [basex-talk] docker, creating and deploying the dba docker-image

2021-11-29 Thread Michael Seiferle
Hi Rob, 

Glad you got it up and running :)

> Am 27.11.2021 um 16:39 schrieb Rob Stapper :
> 
> Hi Michael,
>  
> Thanx for the extended answer. Eventually I got it working with my web 
> application and xquey-modules as part of the image. I had a little trouble 
> with the ownerships of the mounted datafiles but ‘chown’ under the ‘root’ 
> solved that one.
Yeah, I think the obvious solution to this would be running the entire image as 
root — which may or may not impose a security issue in your architecture.

> I find the image size a pretty big: 400Mb against the 227 Mb of the regular 
> ‘basex/basexhttp’-image.
Yeah I think you could boil this down to a few megabytes (using the alpine 
variant) — but I moved to arm (thanks Apple M1) recently there is no OpenJDK / 
Alpine Image yet, hence the size.

> On the other hand the performance is much better then a basexhttp-container 
> with my code mounted on container-creation. I’m content for now, I’ll grab a 
> beer.
Just a guess, but maybe that performance plus stems from the use of different 
JDKs? 
My example contains JDK 11 — the official BaseX Docker is running  JDK 8. I 
think we might consider updating our official image. 



Best
Michael 
>  
> Cheers,
> Rob
>  
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
>  
> From: Michael Seiferle <mailto:m...@basex.org>
> Sent: Friday, November 26, 2021 6:04 PM
> To: Rob Stapper <mailto:r.stap...@lijbrandt.nl>
> Cc: basex-talk@mailman.uni-konstanz.de 
> <mailto:basex-talk@mailman.uni-konstanz.de>
> Subject: Re: [basex-talk] docker, creating and deploying the dba docker-image
>  
> Hi Rob, 
>  
> this answer contains two parts, but tldr: if you mount nothing to 
> /srv/basex/webapp the DBA should already be present.
>  
> Now the slightly longer part:
>  
> But I’m confused what directories to mount on: ‘/srv/basex/repo’ and 
> ‘/srv/basex/webapp’? 
> I can’t find the docker-run example for this.
>  
> Can you shine some more light on the issue.
>  
>  
> Inside the docker image, the home-folder is /srv/basex, hence:
>  
> The /srv/basex/repo Folder contains all XQuery modules that can be imported 
> from your query files, using the BaseX module resolution.
>  
> From the documentation: 
> Points to the Repository, in which all XQuery modules are located.
> https://docs.basex.org/wiki/Repository 
> <https://docs.basex.org/wiki/Repository>
>  
> The webapp folder on the other hand contains your RestXQ-annotated-XQuery  
> files, and is configured via the WEBPATH property:
>  
> WEBPATH
> Signature WEBPATH [path]
> Default {home}/webapp
> Summary Points to the directory in which all the Web Application 
> contents are stored, including XQuery, Script, RESTXQ and configuration files
>  
>  
> As the docker container is (more or less) the ZIP-File extracted to a 
> specific location, it behaves very much like starting basexhttp from the 
> commandline.
>  
> When you download the BaseX Zipfile, you run:
>  bin/basexhttp 
> Which in turn runs: java -cp ${all-basex-libraries-and-jarfiles}  
> org.basex.BaseXHTTP
>  
> The BaseXHTTP-process now looks for the given folders in the current home 
> directory: 
>  
> - `data` => for databases
> - `repo` => for XQuery modules
> - `webapp` => for web applications
>  
> 
> When it comes to docker, the home directory is /srv/basex, with the following 
> layout:
>  
> /srv/basex/data => for databases
> /srv/basex/repo => for XQuery modules
> /srv/basex/webapp => for RestXQ-annotated stuff such as the dba
>  
>  
> As the ZIP-File contains the DBA, all needed files should be already present, 
> if you did not mount something else into /srv/basex/webapp.
>  
> If you want to add your own RestXQ endpoints for example, the safe way is to 
> mount them into a subfolder of /srv/basex/webapp, for example: 
>  
> docker run -d \
> --name basexhttp \
> --publish 1984:1984 \
> --publish 8984:8984 \
> --volume "$HOME/basex/data":/srv/basex/data \
> --volume "$(pwd)/webapp/myapp":/srv/basex/webapp/myapp \
>   basex/basexhttp:latest
>  
> That way the webapp folder in the docker container keeps the DBA and also has 
> your files present.
>  
>  
> If you plan to distribute your image I’d suggest building your own image with 
> a Dockerfile. 
> I created a minimal example here: 
> https://git.basex.io/basex-org/basex-app-with-docker 
> <https://git.basex.io/basex-org/basex-app-with-docker> 
> All I’ve done is: download BaseX.zip, extract BaseX.zip, add a Dockerfile to 
> build the image.
>

Re: [basex-talk] docker, creating and deploying the dba docker-image

2021-11-26 Thread Michael Seiferle
Hi Rob, 

this answer contains two parts, but tldr: if you mount nothing to 
/srv/basex/webapp the DBA should already be present.

Now the slightly longer part:

> But I’m confused what directories to mount on: ‘/srv/basex/repo’ and 
> ‘/srv/basex/webapp’? 
> I can’t find the docker-run example for this.
>  
> Can you shine some more light on the issue.



Inside the docker image, the home-folder is /srv/basex, hence:

The /srv/basex/repo Folder contains all XQuery modules that can be imported 
from your query files, using the BaseX module resolution.

From the documentation: 
>   Points to the Repository, in which all XQuery modules are located.
https://docs.basex.org/wiki/Repository 

The webapp folder on the other hand contains your RestXQ-annotated-XQuery  
files, and is configured via the WEBPATH property:

> WEBPATH
> Signature WEBPATH [path]
> Default   {home}/webapp
> Summary   Points to the directory in which all the Web Application 
> contents are stored, including XQuery, Script, RESTXQ and configuration files


As the docker container is (more or less) the ZIP-File extracted to a specific 
location, it behaves very much like starting basexhttp from the commandline.

When you download the BaseX Zipfile, you run:
>  bin/basexhttp 
Which in turn runs: java -cp ${all-basex-libraries-and-jarfiles}  
org.basex.BaseXHTTP

The BaseXHTTP-process now looks for the given folders in the current home 
directory: 

- `data` => for databases
- `repo` => for XQuery modules
- `webapp` => for web applications


When it comes to docker, the home directory is /srv/basex, with the following 
layout:

/srv/basex/data => for databases
/srv/basex/repo => for XQuery modules
/srv/basex/webapp => for RestXQ-annotated stuff such as the dba


As the ZIP-File contains the DBA, all needed files should be already present, 
if you did not mount something else into /srv/basex/webapp.

If you want to add your own RestXQ endpoints for example, the safe way is to 
mount them into a subfolder of /srv/basex/webapp, for example: 

> docker run -d \
> --name basexhttp \
> --publish 1984:1984 \
> --publish 8984:8984 \
> --volume "$HOME/basex/data":/srv/basex/data \
> --volume "$(pwd)/webapp/myapp":/srv/basex/webapp/myapp \
>   basex/basexhttp:latest


That way the webapp folder in the docker container keeps the DBA and also has 
your files present.


If you plan to distribute your image I’d suggest building your own image with a 
Dockerfile. 
I created a minimal example here: 
https://git.basex.io/basex-org/basex-app-with-docker 
 
All I’ve done is: download BaseX.zip, extract BaseX.zip, add a Dockerfile to 
build the image.



Hope this helps  :-)



Michael



> Am 26.11.2021 um 14:50 schrieb Rob Stapper :
> 
> I’ve mounted ‘c:/Program Files (x86)/basex/data’ on ‘/srv/basex/data’ 
>  
> 



Re: [basex-talk] Versioning in BaseX

2020-11-05 Thread Michael Seiferle
Hi Flurb,

This won’t work without some extra effort from your side; I am not sure what 
part of the https://docs.basex.org/wiki/Database_Module 
 you are referring to.

XQuery however is a full-fledged programming language, so you might implement a 
versioning mechanism on your own; however if your experience using XQuery is 
rather limited, that might not be the best starting project :-)

You might have a look at https://sirix.io  — it has been 
created by our friend Johannes, which might be more suitable :-)

Best
Michael


> Am 04.11.2020 um 14:13 schrieb Rob :
> 
> Hi all,
> 
> I first created an Github Issue for this question, but that’s not the right 
> play :)
> 
> So hereby my question:
> 
> I was wondering how versioning works in BaseX.
> So I have a XML file, I store another version of that same XML file and 
> within BaseX there is some kind of versioning so I can retrieve both versions 
> of the XML file.
> 
> I look into your mail archive, and I found the following mail:
> https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg07369.html 
> 
> 
> Here it states that with using database metadata (Database Module, 
> https://docs.basex.org/wiki/Database_Module 
> ), you can achieve versioning. 
> But I don't see anything about it in the documentation. So I was wondering if 
> it is a thing in BaseX (versioning), and how it's accomplished 
> 
> Thanks!
> 
> Kind regards,
> Rob Tjalma



Re: [basex-talk] Docker Image fails on initialization

2020-10-22 Thread Michael Seiferle
Hi Moishy, 

I think you simply mixed up the arguments.

Arguments that come after the container name will be passet to the running 
container, arguments that come before will be passed to the docker daemon.

For example:
>> https://docs.docker.com/engine/reference/run/

You want to pass your arguments to the docker daemon, as it is the docker 
daemon that will: publish the ports and mount the volume(s), so if you change 
your command to:
> docker run --name basexhttp --publish 8984:8984 --volume 
> "$HOME/basex/data":/srv/basex/data  basex/basexhttp:latest

It should work as intended :-)

Best
Michael





> Am 22.10.2020 um 00:37 schrieb Moishy Uminer :
> 
> Hi, I downloaded the basex/basexhttp docker image, and upon running docker 
> run --name basexhttp basex/basexhttp:latest --publish 8984:8984 --volume 
> "$HOME/basex/data":/srv/basex/data I received the following error message:
> /usr/local/bin/mvn-entrypoint.sh: exec: line 50: illegal option -- after 
> which the container exits.
> 
> Did I do something wrong (in which case I'll be happy to hear of my error), 
> or is this a bug (in which case I'd appreciate it if this were fixed).
> 
> Thanks in advance!



Re: [basex-talk] missing web.xml from docker image

2020-09-15 Thread Michael Seiferle
Hi Nicholas, 

I think this might be indeed a good chance to re-engineer our docker image. 
We had one user that maintained the image long time ago, but maybe it would be 
good to have it updated. 
We don’t tend to use docker that often, as you might have noticed ;-)

best
Michael


> Am 05.09.2020 um 02:24 schrieb Nicholas Saunders 
> :
> 
> 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
>>> 
>>> 
>> 



Re: [basex-talk] RESTXQ path resolution

2020-07-31 Thread Michael Seiferle
Hi Ben, 



> Am 30.07.2020 um 22:23 schrieb Ben Pracht :
> 
> * From testing, it appears that the basexhttp server also starts the database 
> server.  From the options available in .basex, I was under the impression I 
> had to start basexserver separately, but when I tried to run basexserver and 
> subsequently basexhttp, the basexhttp server said the port was already in 
> use.  

Yes that is right; it will start both the HTTP-Server and the BaseX Server
https://docs.basex.org/wiki/Web_Application 

>> An instance of the Jetty Web Server  will be 
>> started, which by default listens to the port 8984. Additionally, the BaseX 
>> Database Server  will be 
>> started, accessible on port 1984. The command-line output will look 
>> something like that (the JSP warning message can be ignored 
>> ):
> 



> * It's probably obvious to people who write RESTXQ code readily, but it seems 
> worthwhile to note that the services run on the basexhttp server JVM, and not 
> the basexserver JVM.  Because I anticipate needing multiple databases, I'm 
> trying to set up the server so that it can fork work over to the appropriate 
> database.  It would be nice if I could have XQUERY code running at the 
> basexserver JVM.

This might be a little more work, you could start multiple BaseXServer 
Instances and use the client module [1] to connect to these instances and run 
queries on them.
https://docs.basex.org/wiki/Client_Module 



So you’d basically have an restxq endpoint, and the endpoint decides which 
query to send to which basexserver via the client module.


> 
> * In my .basex file, I specify 
> HOST=localhost
> PORT=1984
> SERVERPORT=1984
> SERVERHOST=localhost
> 
> Since it's the basexhttp that starts the basexserver, it's not clear to me 
> which is considered the server, but nonetheless, somehow I'm able to get the 
> above to at least partially function, though I'm confident that I did this 
> wrong.  

The options are explained here, 

https://docs.basex.org/wiki/Options#Client.2FServer_Architecture 


basexclient uses these options: 
>> HOST: This host name is used by the client when connecting to a server. 
>> PORT: This port is used by the client when connecting to a server.

basexserver uses these options:
>> SERVERPORT: This is the port the database server will be listening to.
>> SERVERHOST:  This is the host name or ip address the server is bound to

IIRC these Options originated in the times before basexhttp / RestXQ :-)

> 
> * I noticed there's a REST and a RESTXQ, for most part would I always want to 
> use RESTXQ?

RestXQ is way more flexible (in my opinion ;-)) and a lot more developer 
accessible (again in my opinion) for building web applications. 

> 
> I hope those who write the documentation do not take offense to my questions.
Not at all  :)
> I'm not sure I would have thought to document it or how to write it in such a 
> way that it doesn't get asked.
I think the many possibilities and features make it very hard to convey all the 
information needed at any time :-)

> This project is one of the best documented in the OSS community, and even 
> better than some products for which money changes hands.
Thank you very much! :)
> 
> Thanks,
> Ben
Hope this helps!
Michael



Re: [basex-talk] RESTXQ path resolution

2020-07-13 Thread Michael Seiferle
Hi Ben,

Make sure to first read my previous mail, because you need a working 
restxq-Setup ;-)

Theres the „rest:wadl()“ function, that generates a representation of all 
available endpoints.

I added it to my example project, feel free to check it out here:
> https://git.basex.io/basex-public/mailinglist-autocomplete/-/commit/84fda246ca3d1dfe7319ff4a401aa1504feee48a

The result will look something like this: 
[…]









[…]

Hope this helps :-)

Michael 


> Am 13.07.2020 um 00:31 schrieb Ben Pracht :
> 
> 
> 
> In my case, I put the hello-world service in the main project directory, in 
> the modules directory where the RESTXQPATH and in the RESTPATH.  I've tried 
> renaming the hello-world to .xq, .xqm and .xqy.  In all cases, it does not 
> find the .xq file.  
> 
> Best Regards,
> Ben Pracht
> 919.809.2439



Re: [basex-talk] Change static directory for html pages

2020-07-13 Thread Michael Seiferle
Hi Ben, 

Sorry for the belated response — maybe you forgot to update the web.xml file?

RestXQ-Resolution works as follows: 

The .basex file configures **where on disk** the RestXQ-Servlet looks für 
XQuery modules: 

The following options can be set: 

* WEBPATH
> Points to the directory in which all the Web Application 
>  contents are stored, including 
> XQuery, Script, RESTXQ  and configuration 
> files:


In your case: PROJECT_ROOT/webapp

* RESTXQPATH

If this a relative path, it will be relative to your WEBPATH — so setting it to 
„modules“ will resolve to:
PROJECT_ROOT/webapp/modules

Now this summarizes it for your on disk-context ;-)

Switchting to the Servlet-context, you must make sure to tell the Container 
where to server your RESTXQ-Servlet: 
This can be seen in Web.xml here: 
> https://git.basex.io/basex-public/mailinglist-autocomplete/-/blob/main/webapp/WEB-INF/web.xml#L81-84
  
RESTXQ
/api/*
  

So basically you need to tell jetty, or whatever container you have, what’s the 
ROOT-Url for the RESTXQ contents. 
So in my web.xml anything *under* /api/ will be sent to the RESTXQ-Servlet 
which in turn tries to make sense of the URL and resolve it against your XQuery 
annotations :-)

Hope this helps

Michael

> Am 10.07.2020 um 23:28 schrieb Ben Pracht :
> 
> Thanks Michael,
> 
> I cloned your repo and borrowed your .basex file.  It did indeed allow me to 
> specify the page location.  However, I'm not able to get it to find my RESTXQ 
> is my services.  I added the out of the box BaseX ./bin to my PATH and 
> changed to a completely different directory.  Attached is my .basex and 
> database-services.xqm file.  For debugging purposes, I wanted to make sure my 
> services point to the right database.  My setup is like this:  
> 
> PROJECT_ROOT/.basex
> PROJECT_ROOT/.basexhome
> PROJECT_ROOT/modules/database
> PROJECT_ROOT/webapp/modules/database-services.xqm
> PROJECT_ROOT/modules/database-services.xqm
> 
> I duplicated the database-services file because I wasn't sure what folder the 
> RESTXQ was relative to.  
> 
> Vielen Danke!
> 
> Best Regards,
> Ben Pracht
> 919.809.2439
> ben.pra...@gmail.com 


Re: [basex-talk] Handling saving errors

2020-07-06 Thread Michael Seiferle
Hi Ramzi, 

I am not sure whether your are using RestXQ, however if you do, the 
implementation should take care of this by itself.

XQuery update in general either applies the whole updating query, or cancels 
all updates:

Take the following example db containing 5 documents.

> db:create("mailinglist",
>   (1 to 5) ! ,
>   (1 to 5) ! ("doc-"|| . ||".xml")
> )


Now if you ran an update: 
> for $i in 1 to 5
> let $x := if($i > 4) then error() else ()
> return (
>   prof:dump($i, "Inserting "),
>   insert node element _ {
>"Hello World"
>   } as last into db:open("mailinglist", "doc-"||$i||".xml")
> )

You can see in the GUI / Debug View, that the code for inserting the elements 
in the first 4 Documents is executed, and thus the pending update list is 
populated in memory. 

Once the Query throws the error() the whole query is cancelled and the pending 
update list is discarded.

Hence no changes are applied to your databases, if you manage to handle the 
whole update in a single transaction.

Feel free to ask for more information!

Best
Michael
 
> Am 06.07.2020 um 08:38 schrieb Ramzi Hammouda 
> :
> 
> Hello BaseX team,
> We're developing an application where a command can result in saving data on 
> multiple xml documents in the same database. We're using Rest APIs. Now, 
> We're looking on handling saving errors. For example, if there were an error 
> in saving data on a one document, then the saving of data on other documents 
> must be canceled (even if there were successful updates, they must be 
> canceled). How can this be implemented?
>  
> Thanks.
>  
> 
> P Respectons ensemble l'environnement. N'imprimez ce message que si 
> nécessaire. Let's respect the environment together. Only print this message 
> if necessary.



Re: [basex-talk] Change static directory for html pages

2020-07-03 Thread Michael Seiferle
Hi Ben,

Glad you enjoy setting up a restxq project, we use it as a primary driver of 
our Web-applications 

I set up a small project (in response to a related question last week), that 
serves static content from /webapp at „http://localhost/“ and maps all restxq 
endpoints to http://localhost/api

=> https://git.basex.io/basex-public/mailinglist-autocomplete
This might be a good start for you future endeavors :-)

The relevant settings are found in „.basex“ (This file defines where on disk to 
look for static and restxq files) and „ webapp/ WEB-INF/ web.xml“ (defines at 
what path static files and restxq endpoints are served by the Webserver).

These  options are explained here 
 https://docs.basex.org/wiki/Options#HTTP_Services and 
https://docs.basex.org/wiki/Web_Application#Services 

 You should be fine using ant  

Feel free to ask for more information :-)

Best
Michael



Von meinem iPhone gesendet

>> Am 03.07.2020 um 09:19 schrieb Ben Pracht :
> 
> Hi,
> I'd like to serve static content in the same server as the one handling the 
> restxq.  However, I noticed it expects the content to be in some level under 
> the static directory. Then, the URL also needs the static directory. 
> 
> Is it possible to change both the directory the static files live and the 
> URL?  That way I can create a site without requiring the end user to append 
> static to the URL to get to index.html.
> 
> Ultimately, I want to create static pages, restxq services, schemas and a 
> database, but have them isolated from the BaseX distribution.  I've seen some 
> flags to specify some directory locations, but not the static one.
> 
> I'm using Ant so I can take the source distribution, copy that to a target 
> directory, and in another step, copy my source files.  I realize Ant is old, 
> but I have no idea how to do this in Maven.
> 
> By the way, I absolutely love how easy it is to do a site yet it actually 
> seems quite powerful.
> 
> Kind Regards,
> Ben


Re: [basex-talk] Autocomplete with RESTXQ

2020-06-28 Thread Michael Seiferle
You’re welcome.
Glad I could help save some time, I agree it looks simple, yet wrapping ones 
head around those small details can be a real showstopper sometimes :-)
Feel free to ask for more details anytime.

Looking forward to seeing said search portal!


Best from Konstanz
Michael 
Von meinem iPhone gesendet

> Am 27.06.2020 um 14:13 schrieb Imsieke, Gerrit, le-tex 
> :
> 
> This looks quite simple but you probably saved me two to four hours of 
> figuring out which lib to use, how to invoke the completion and how to shape 
> the server response. Will try to use it in my app tomorrow.


Re: [basex-talk] Autocomplete with RESTXQ

2020-06-26 Thread Michael Seiferle
Hi Gerrit, 

I came up with the following example — 
https://git.basex.io/basex-public/mailinglist-autocomplete

Hope this helps — feel free to ask for more. I simply chose the first 
autocomplete library that showed up when asking google for  "autocomplete 
lightweight“ ;-)

Probably the most relevant changes compared to the default BaseX Config files 
are here:

Changed the Servlet mapping, so RESTXQ is output at `/api` (and not /)
> https://git.basex.io/basex-public/mailinglist-autocomplete/-/blob/main/webapp/WEB-INF/web.xml#L83

And static-files are output at: `/` instead of the default `/static`
> https://git.basex.io/basex-public/mailinglist-autocomplete/-/blob/main/webapp/WEB-INF/web.xml#L140


If you simply clone my repo, the relevant parts should be „correct“ — according 
to my personal taste ;-)

Feel free to ask for more help.

Michael

> Am 25.06.2020 um 18:31 schrieb Imsieke, Gerrit, le-tex 
> :
> 
> Hi List,
> 
> Can anyone recommend a lightweight vanilla Javascript autocomplete library 
> that can easily be used together with BaseX RESTXQ? Maybe even a readily 
> cloneable/modifiable example?
> I don’t have a preference for a server response format. The RESTXQ service 
> may be configured to return XML, JSON, or HTML
> No CORS restrictions need to be considered, the query host is the same that 
> delivers the HTML pages.
> 
> Gerrit



Re: [basex-talk] Flat XML fods database

2020-02-14 Thread Michael Seiferle
Hi Thufir, 

I think you might look up the namespaces from the Libre Office File like so: 
> (
>   for $node in $doc//(@*,*)
>   let $nn := node-name($node)
>   let $ns-uri := namespace-uri-from-QName($nn)
>   let $prefix := prefix-from-QName($nn)
>   where $ns-uri
>   return ``[declare namespace `{ $prefix }` = "`{ $ns-uri }`"]``
> ) => distinct-values()
> => string-join(out:nl())
https://git.basex.io/snippets/77 


Other than that you might have to consult the Schema files I guess :)


> Am 14.02.2020 um 09:27 schrieb thufir :
> 
> I think I mainly need to add a namespace for fods:
> 
> 
> thufir@dur:~/fods/flwor$
> thufir@dur:~/fods/flwor$ basex text.xq
> Stopped at /home/thufir/fods/flwor/text.xq, 3/14:
> [XPST0081] No namespace declared for 'text:p'.
> thufir@dur:~/fods/flwor$
> thufir@dur:~/fods/flwor$ cat text.xq
> 
> for $foo  in db:open("foo")
> return $foo//text:p
> 
> thufir@dur:~/fods/flwor$
> 
> 
> https://stackoverflow.com/q/60222478/262852
> 
> 
> 
> how do I know all the namespacess?  from the libre office file?



Re: [basex-talk] Test if basexserver is running?

2019-08-30 Thread Michael Seiferle
Hi Ben, 

I maybe don’t fully get your question right (and I admin I do not know much 
about R), but I’d simply open the socket on the port I expect BaseX to be 
listening on and see whether or not I receive a `BaseX:123456789` response and 
close the connection immediately after.

Best
Michael 

> Am 29.08.2019 um 15:03 schrieb Ben Engbers :
> 
> Hi,
> 
> Last year I have written a R-client for basex
> (https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/r/RbaseXClient.R
>  
> ).
> The present version uses no exception handling and you have to include
> the source-file in your R-code. A much cleaner solution would be catch
> all the errors and to pack the sources in a package. At this moment, I
> am working on such a R-package.
> 
> The first test that should be executed in the package, is to test if a
> basexserver is available.
> 
> How can I test on Linux, Apple and Windows if a baseserver is running?
> 
> Ben



Re: [basex-talk] BaseX Docker logs

2019-08-30 Thread Michael Seiferle
Hi Marie, 

I think the log files should be located inside your container at:
> /srv/basex/data/.logs # for current basex versions

Or for your version:

> /srv/BaseXData/.logs # for BaseX 8.6.4 

Maybe you can check your output for:
>  docker run basex/basexhttp:8.6.4
> a6e…
=> 
>  docker exec -ti a6e ls -la /srv/BaseXData/.logs
> total 12
> drwxr-xr-x 2 basex basex 4096 Aug 30 07:38 .
> drwxr-xr-x 3 basex root  4096 Aug 30 07:38 ..
> -rw-r--r-- 1 basex basex  129 Aug 30 07:38 2019-08-30.log


Hope this helps — sorry to hear your container exits unexpectedly!

Best
Michael
> Am 27.08.2019 um 15:16 schrieb Marie Starck :
> 
> Hello,
> 
> I am currently running a BaseX server with Docker and for the past week, it 
> has exited twice with this message: /usr/local/bin/basexhttp: line 20:25 
> Killed  java -cp "$CP" $BASEX_JVM org.basex.BaseXHTTP "$@"
> 
> I want to debug more but I haven't been able to find the basex .logs in my 
> docker container. I am using basexhttp:8.6.4.
> 
> Any ideas where it could be?
> 
> Thank you very much,
> 
> Marie



Re: [basex-talk] Binary module

2019-08-14 Thread Michael Seiferle
Hi Guiseppe, 

1) You are right, it’s not too obvious what’s happening here: 
In BaseX the default serialization mode is „basex“ which tries to return items 
in a more readable way, hence internally your string is represented as 
xs:base64Binary — but when it is output to the query results panel it will be 
serialized according to whichever serialization is active; we opted for our 
custom serialization as we considered it to be a sane default, as it is able to 
serialize() all kinds of items (i.e. XML serialization won’t serialize maps or 
arrays) and is generally a little more readable than adaptive because we omit 
type information such as xs:base64Binary("c8Ogw6A=")

The following query serializes your value with different serialization 
parameters. 
> let $it := convert:string-to-base64("sàà")
> 
> for $method in (
>   "basex", "xml", "adaptive", "json", "text","html"
> )
> return element { $method } {  
>   serialize( 
> $it,
> map{ "method": $method }
>   )
> }



2) The length method basically tells you how many bytes your string needs to be 
encoded as utf8, you may use the following query and try it yourself:
> let $str := "•"
> let $bin := convert:string-to-base64($str)
> return element _ {
>   element str { $str },
>   element b64 { $bin },
>   element octets {
>attribute length { bin:length($bin) },
>for $byte in $bin => convert:binary-to-integers() 
>return element octet {
>  $byte => convert:integer-to-base(2)
>}
>   }  
> }

Depending on the input string and it’s encoding (i.e. ‚a' will only need one 
byte, but ‚ä' already needs two, ‚•' will even need three in utf8) your string 
is converted to xs:base64Binary and the bin:length() function will count how 
many octets are needed for this representation.

Hope this helps :-)

Best
Michael


> Am 14.08.2019 um 02:22 schrieb Giuseppe G. A. Celano 
> :
> 
> Hi
> 
> I am playing around with the binary module. I have two simple questions:
> 
> 1) convert:string-to-base64("sàà") returns sàà : what does it mean? I see in 
> the documentation that I need to use string() to see the value of 
> xs:base64Binary (c8Ogw6A=), but shouldn't xs:base64Binary already be 
> outputted as c8Ogw6A= ? (This is actually displayed in the Info Panel).
> 
> 2) bin:length(convert:integers-to-base64(x)) always returns one number, no 
> matter how big the number is. In the documentation I read that the output of 
> bin:length should be the size of binary data in octects: how is that possible?
> 
> Thanks,
> Giuseppe
> 
> 



Re: [basex-talk] Connecting the BaseX AppChecker to Visual Studio

2019-07-08 Thread Michael Seiferle
Hi Matt,

Sorry I can’t be of more help, but we at BaseX don’t know too much about the 
AppChecker-Project.

I know we’ve been contacted by Microsoft’s Peter Villadsen and asked whether he 
may use / pre-install BaseX for an X++ project at Microsoft, but since 
confirming that our license would enable Microsoft to use and include BaseX in 
their products we haven’t received any feedback so far. 

Feel free to provide some more context :-)

Best 
Michael



Von meinem iPhone gesendet

> Am 08.07.2019 um 17:31 schrieb Matt Stam :
> 
> Hello, 
> 
> I've been trying to set up and use the "AppChecker" that we are going to need 
> to run our X++ code through. Does anyone have any knowledge on how to run 
> this?
> 
> I've followed everything laid out on their github: 
> https://github.com/microsoft/Dynamics365FO-AppChecker. BaseX and the 
> environmental variables are installed. But I am unsure about how to actually 
> use it to check my code on VS.
> 
> Any help would be appreciated.
> 
> Best,
> Matt


Re: [basex-talk] Using the attribute index to get attribute values

2019-06-12 Thread Michael Seiferle
I am not sure about your data exactly, but, the element hierarchy can be 
preserved:
> (: http://files.basex.org/xml/factbook.xml :)
> index:facets('factbook')//element[@name="continent"]/attribute[@name="id“]
Will return only the id values of elements named continent :-)

Or in your example you might want to change this to „element[@name='country‘]“

One thing to consider, the maximum number of distinct-values that will be added 
to the index is defined by the maxcats option:
http://docs.basex.org/wiki/Options#MAXCATS

Best
Michael


> Am 12.06.2019 um 16:48 schrieb France Baril :
> 
> But facets would return @type values for all @type and I need only those on 
> .
> 
> On Wed, Jun 12, 2019 at 4:34 PM Michael Seiferle  <mailto:m...@basex.org>> wrote:
> Hi France, 
> 
> that’s just a wild guess, but maybe the index:facets() might be of help here?
> It works directly on the index information, so the queries should be 
> sufficiently fast if the results of index:facets() fulfill your needs.
> 
> http://docs.basex.org/wiki/Index_Module#index:facets 
> <http://docs.basex.org/wiki/Index_Module#index:facets>
> 
> 
> The idea of db:attribute-values() is an idea worth discussing as well.
> 
> Best from Konstanz
> 
> Michael
> 
> 
> 
>> Am 12.06.2019 um 09:07 schrieb France Baril > <mailto:france.ba...@architextus.com>>:
>> 
>> Hi, 
>> 
>> I have been implementing more queries that use the attribute indexes lately. 
>> However a lot of my queries require getting values to offer selectable items 
>> in user forms (GUI). I have not found a good way to do that.
>> 
>> For example, I tried changing : 
>>   let $account-types := distinct-values(db:open($db-name)//account/@type)
>> to 
>>   let $account-types := distinct-values(db:attribute-range($db-name, 'a', 
>> 'zz', 'type')[parent::*/name() = 'account'])
>> 
>> I looked for a function that would be more like 
>>   let $account-types := db:attribute-values($db-name, 
>> 'type')[parent::*/name() = 'account]
>> 
>> I'm not getting any performance improvements with the db:attribute-range 
>> compared to the regular db:open($db-name). and I am assuming that the issue 
>> is that since I provide a range, it has to check every value individually as 
>> opposed to just grabbing everything in the named attribute.
>> 
>> Any chance we can get values at some point? Or do you have a suggestion to 
>> improve this type of query?
>> 
>> 
>> 
>> 
>> -- 
>> France Baril
>> Architecte documentaire / Documentation architect
>> france.ba...@architextus.com <mailto:france.ba...@architextus.com>
> 
> 
> 
> -- 
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com <mailto:france.ba...@architextus.com>



Re: [basex-talk] Using the attribute index to get attribute values

2019-06-12 Thread Michael Seiferle
Hi France, 

that’s just a wild guess, but maybe the index:facets() might be of help here?
It works directly on the index information, so the queries should be 
sufficiently fast if the results of index:facets() fulfill your needs.

http://docs.basex.org/wiki/Index_Module#index:facets


The idea of db:attribute-values() is an idea worth discussing as well.

Best from Konstanz

Michael



> Am 12.06.2019 um 09:07 schrieb France Baril :
> 
> Hi, 
> 
> I have been implementing more queries that use the attribute indexes lately. 
> However a lot of my queries require getting values to offer selectable items 
> in user forms (GUI). I have not found a good way to do that.
> 
> For example, I tried changing : 
>   let $account-types := distinct-values(db:open($db-name)//account/@type)
> to 
>   let $account-types := distinct-values(db:attribute-range($db-name, 'a', 
> 'zz', 'type')[parent::*/name() = 'account'])
> 
> I looked for a function that would be more like 
>   let $account-types := db:attribute-values($db-name, 
> 'type')[parent::*/name() = 'account]
> 
> I'm not getting any performance improvements with the db:attribute-range 
> compared to the regular db:open($db-name). and I am assuming that the issue 
> is that since I provide a range, it has to check every value individually as 
> opposed to just grabbing everything in the named attribute.
> 
> Any chance we can get values at some point? Or do you have a suggestion to 
> improve this type of query?
> 
> 
> 
> 
> -- 
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com 



Re: [basex-talk] Docker basex/basexhttp 9.2.2?

2019-06-12 Thread Michael Seiferle
Great! :-)

Von meinem iPhone gesendet

> Am 12.06.2019 um 10:16 schrieb Jörn Willhöft :
> 
> Hi Michael,
> 
> it became available on docker hub tonight. Thanks!
> 
> Cheers,
>  Jörn
> 
> 
> 
>> Michael Seiferle  hat am 11. Juni 2019 um 12:14 geschrieben:
>> 
>> 
>> Hi Jörn,
>> 
>> Sorry for letting you wait!
>> 
>> Seems there was a disconnection between our GitHub Repository and the 
>> Dockerhub AutoBuild — I reconfigured it and the updated image should be 
>> available by this afternoon!
>> 
>> Best & thanks for reporting!
>> 
>> Michael
>> 
>>> Am 05.06.2019 um 18:46 schrieb Jörn Willhöft :
>>> 
>>> Hi BaseX Team, 
>>> 
>>> I just realized, that there is no current docker release for BaseX 9.2. 
>>> Which contains a feature (www-authenticate override) I need. Is it planned 
>>> to be released soon? 
>>> 
>>> As I easily migrated from 9.1.2 it shouldn't be much effort. 
>>> 
>>> Cheers, 
>>>  Jörn
>> 


Re: [basex-talk] Use of xs:hexBinary() comes with strange results

2019-06-11 Thread Michael Seiferle
Hi Andreas,

I think what you are observing is the following: 

UTF-8 encoded stings can optionally denote a multi-byte sequence, with the 
number of leading 1-s defining the multibyte pattern length.
c.f. https://en.wikipedia.org/wiki/UTF-8 

In your example, c3 decodes to: 
> xs:hexBinary("c3")
> => convert:binary-to-integers()
> => for-each(convert:integer-to-base(?,2))
> (: returns: 1111 :)
And the two leading 1s will tell the UTF-8 decoder to read a second byte — 
which is missing — hence decoding fails with an error or if you use the 
fallback-option it will return a �

While decoding ASCII, where only 127 bits are used, this is no problem as UTF-8 
shares the same character positions with the ascii table.

Your „C3“ character however is not in ascii but most probably ISO-8859-1 or 
CP1252? So while a glance at https://tools.ietf.org/html/rfc3986 
 says URI Characters should be encoded in 
UTF-8 in practice 
chances are you encounter values that are encoded using some „local“ encoding.

If your string is not UTF-8 encoded you may only guess what the correct 
encoding is.

You may send a predefined string that is known to be of two bytes length in 
UTF-8, such as: ä that will be either converted to „%C3%A4“  if it is unicode 
or to a well known single byte such as for example „E4“ in ISO-8859-1.
Depending and what you receive by your client for that given string you may 
assume it encodes its data either utf-8 or latin1. 

You can check what your string would be encoded to: 
> string(convert:string-to-hex('ä',"latin1")) 


Sorry for the long mail, hope the explanation is useful for you, even though 
the solution is not sooo simple and involves guessing :-)

Best
Michael 





> Am 09.06.2019 um 17:09 schrieb Andreas Mixich :
> 
> How can I simply get back any character, readable by a human, from a 
> hexadecimal value?
> 



Re: [basex-talk] Health Analyzer registration issue

2019-06-11 Thread Michael Seiferle
Hi Ganesh, 

Sorry, but seems your email somehow got misdirected to us?
We’ll be glad to support your colleagues at VMware however I am not sure what 
caused this bug by just looking at your screenshot ;)

Best
Michael


> Am 11.06.2019 um 08:02 schrieb Ganesh Joshi Regmi (c) 
> :
> 
> Hi Team,
>  
> I am trying to register the VMware Health Analyser OVA with code that I 
> received after registering via my employee email. However, I am unable to 
> complete the registration with below error.
>  
> 
>  
> Can you please look at this and revert back with solution.
>  
>  
> Cheers,
> Ganesh
>  
> Ganesh Joshi Regmi | Senior PSO Consultant
> VCP-4,5,6 | VCP- NV | VCAP-NV | VCAP-DCA
> VMware Australia & New Zealand 
> +61 452 409 609 | gjoshire...@vmware.com   
>  
> Level 8 175 Pitt Street, Sydney NSW 2000
>  
>     
>  
> 
>  
>  



Re: [basex-talk] Improper Use? Potential bug?

2019-06-04 Thread Michael Seiferle
Hi Buddy, 

that looks like a bug. 

Would you mind sharing your XQuery or a SSCE?
I think this is definitely something we might want to have a look at :-)

Best from Konstanz

Michael 

> Am 03.06.2019 um 13:12 schrieb Buddy Kresge :
> 
> I am all of a sudden getting the below error (and things were working just 
> fine – weird).  Works fine in 9.1.2 but not in 9.2.X.  Any guidance would be 
> greatly appreciated.
>  
> Note:  I tried to send you an email with the full stack trace, but the 
> moderator rejected it because the email was too long.  I’ve cut down the 
> size, but you now no longer have the full stack trace.  If you need the full 
> stack trace, please let me know how you’d like that shared with you.
>  
> Thanks,
> Buddy
>  
> Error:
> Improper use? Potential bug? Your feedback is welcome:
> Contact: basex-talk@mailman.uni-konstanz.de 
> 
> Version: BaseX 9.2
> Java: AdoptOpenJdk, 1.8.0_202
> OS: Windows 10, amd64
> Stack Trace: 
> java.lang.ArrayIndexOutOfBoundsException: 1
>at org.basex.query.expr.Preds.simplify(Preds.java:215)
>at org.basex.query.expr.Filter.optimize(Filter.java:82)
>at org.basex.query.expr.Filter.inline(Filter.java:260)
>at org.basex.query.expr.gflwor.ForLet.inline(ForLet.java:66)
>at org.basex.query.expr.gflwor.GFLWOR.inline(GFLWOR.java:804)
>at 
> org.basex.query.expr.gflwor.GFLWOR.inlineLets(GFLWOR.java:339)
>at org.basex.query.expr.gflwor.GFLWOR.optimize(GFLWOR.java:106)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:98)
>at org.basex.query.expr.If.compile(If.java:63)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncs.compile(StaticFuncs.java:184)
>at 
> org.basex.query.func.fn.FnFunctionLookup.opt(FnFunctionLookup.java:34)
>at 
> org.basex.query.func.StandardFunc.optimize(StandardFunc.java:77)
>at org.basex.query.expr.Arr.compile(Arr.java:43)
>at org.basex.query.expr.gflwor.ForLet.compile(ForLet.java:43)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:88)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncCall.compile(StaticFuncCall.java:64)
>at org.basex.query.expr.gflwor.ForLet.compile(ForLet.java:43)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:88)
>at org.basex.query.expr.gflwor.ForLet.compile(ForLet.java:43)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:88)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncCall.compile(StaticFuncCall.java:64)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:94)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncCall.compile(StaticFuncCall.java:64)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:94)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncs.compile(StaticFuncs.java:184)
>at 
> org.basex.query.func.fn.FnFunctionLookup.opt(FnFunctionLookup.java:34)
>at 
> org.basex.query.func.StandardFunc.optimize(StandardFunc.java:77)
>at org.basex.query.expr.Arr.compile(Arr.java:43)
>at org.basex.query.expr.gflwor.ForLet.compile(ForLet.java:43)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:88)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncCall.compile(StaticFuncCall.java:64)
>at org.basex.query.expr.gflwor.ForLet.compile(ForLet.java:43)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:88)
>at org.basex.query.expr.gflwor.ForLet.compile(ForLet.java:43)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:88)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncCall.compile(StaticFuncCall.java:64)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:94)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncCall.compile(StaticFuncCall.java:64)
>at org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:94)
>at org.basex.query.func.StaticFunc.comp(StaticFunc.java:69)
>at 
> org.basex.query.func.StaticFuncs.compile(StaticFuncs.java:184)
> 

Re: [basex-talk] XML in HTTP request body

2019-06-03 Thread Michael Seiferle
Hi Jerome, 


If I understand correctly, you want to create a hash value for the string 
serialization of the document you sent to restxq right?

Currently inside RESTXQ your document is treated as an XML Document, hence: 

$body will be of type document-node(): 
> 
>   
> Hello
> World
>   
> 

where as crypto:hmac requires a string-type $message:
> crypto:hmac($message as xs:string, 
Hence your $body will be converted like so: 
> string(
>   
> Hello
> World
>   
> )


Turning it into: 
> „HelloWorld“


In order to actually compute a hash on the bytes your document contains, do as 
follows:

Working example here: https://git.basex.io/snippets/63


Treat your document as binary:
> %rest:consumes("application/octet-stream“)
And then decode that binary to a string and then compute the hash for the 
string, using: bin:decode-string#2:

>   let $str-doc  := bin:decode-string($body,'utf-8') (: xs:string :)
>   let $sig-cand := crypto:hmac($str-doc,$secret,'sha1','base64')


Hope this helps :-)

Michael

> Am 03.06.2019 um 12:17 schrieb Jerome Chauveau :
> 
> Hi,
> 
> I am trying to check XML content (HTTP posted) with an hmac function in a 
> RESTXQ webapp.
> 
> My Java client sends an HTTP post request where XML data looks like :
> 
> doe xsi:schemaLocation="http://www.tei-c.org/ns/1.0;
> xml:id="idtest"
> > > > > >Test > xml:id="authortest"
> >XXX > > > > > > xml:space="preserve"
> > > type="lieu"
> > xml:lang="la"
> >Burgunvilla > > > > > >
> 
> This content is HMAC encrypted and the signature is added to the HTTP  header 
> :
> 
> [...]
> String secret = "1234";
> StringEntity entity = new StringEntity(xml, ContentType.create("text/xml", 
> Consts.UTF_8));
> String signature = HTTPUtils.hmacSHA1(xml, secret);
> httppost.setHeader("Authorization", signature);
> httppost.setEntity(entity);
> [...]
> 
> 
> Here is my RESTXQ function :
> 
> declare
> %rest:POST("{$body}")
> %rest:consumes("application/xml", "text/xml")
> %rest:header-param("Authorization", "{$signature}", "none")
> %rest:path("/sf/testpost")
> function sf.test:testPost($signature,$body){
>   let $secret := 1234
>   crypto:hmac($body,$secret,'sha1','base64') = $signature
> }
> 
> Equality check always fails with such an XML sequence but works fine when XML 
> does not contain any carriage return :
> doeThis is a 
> test
> 
> It seems to come when "The body of a POST or PUT request is converted to an 
> XQuery item".
> 
> I tried to set serializer's options without any success !
> 
> How could I retrieve xml (in $body) exactly serialized as sent by the client 
> ? 
> 
> Tests are running on BaseX922.
> Thank you for your time.
> 
> Jérôme



Re: [basex-talk] Update of arbitrarily selected elements?

2019-06-03 Thread Michael Seiferle
Hi Josh, 

I think the most widely used approach would be addressing items via ID — just 
as you would in a traditional database approach — this might involve adding IDs 
to all elements.

>> (as in, not selectable with a query)
With XPath you can select arbitrary parts of your document, maybe using XPath 
expressions would be helpful?


Hope this helps a bit, feel free to ask for more specific information  :)

Best 

Michael 







> Am 31.05.2019 um 20:14 schrieb Joshua Kordani 
> :
> 
> Greetings all.
>  
> I am curious about how basex supports the idea of modifying any given (or set 
> of given) elements, say a user makes a query to select a bunch of elements 
> for editing and wishes to add an attribute to an arbitrary subset (as in, not 
> selectable with a query), how do I reference a particular element for later 
> updating?
>  
> Sincerely,
> Josh



Re: [basex-talk] Database lock during RESTXQ operation

2019-05-15 Thread Michael Seiferle
Hi Martin, 

hard to tell what went wrong then without looking at your setup.
Did it happen again or has it been a one-time issue?

Best
Michael

--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Obere Laube 73, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Tel: +49 7531 916 82 77

> Am 15.05.2019 um 08:40 schrieb Martin Iggulden 
> :
> 
>  
> Thanks for your feedback. I’m pretty sure that the database is only 
> accessible to a single JVM, but I’ll check it again to be 100% sure. Is there 
> any other possible explanation? I don’t think we’re doing anything too 
> complicated…
> 



Re: [basex-talk] Database lock during RESTXQ operation

2019-05-13 Thread Michael Seiferle
Hi Martin,

This error may happen if (1) two different instances of basex try to 
open/update the very same database.
As BaseX uses standard JVM functionality to acquire the Lock it is very likely 
that indeed to different processes tried to access the very same file.

Maybe there is some kind of shared database between your instances that you are 
trying to access?




Best from Konstanz

Michael



> Am 10.05.2019 um 09:17 schrieb Martin Iggulden 
> :
> 
> the same Java VM because the RESTXQ server is the only active interface to 
> the database.
>  
> We have seen this error before, but it’s difficult to reproduce.
>  
> Do you know how this might have happened? And is there a procedure for 
> clearing down an erroneous database lock if it happens?
>  
> We are running BaseX version 9.1.2.
>  



Re: [basex-talk] HTTP POST as xml

2019-05-06 Thread Michael Seiferle
Hi Robert, 

Yeah, that’s not necessarily obvious, but the type of the document you post is 
„document-node()“ not element() — so simply change the function & argument 
types to document-node() and you will be fine.


Usually the the in-browser debugging > Network view helps with identifying such 
„low-level“ errors, yet I tend to use the command-line more often since I 
discovered httpie[1]

> echo ""|http POST http://localhost:8984/test Content-Type:text/xml
> HTTP/1.1 400 Bad Request
> Stopped at /Users/michael/tmp/ml/webapp/foo.xqm, 5/10:
> [XPTY0004] Cannot convert document-node() to element(): document-node {''}.


Hope this helps & best from Konstanz 

Michael


[1] https://httpie.org



> Am 06.05.2019 um 14:09 schrieb Robert Kirkpatrick :
> 
> Hello,
> 
> I am trying to implement an XForm for posting data via:
> 
> http://localhost:8984/test 
> " method="post" 
>   serialization="application/xml" replace="all" />
> 
> It should invoke the following query (in webapp):
> 
> module namespace page = 'http://basex.org/examples/web-page 
> ';
> declare
>   %rest:path("/test")
>   %rest:POST("{$data}")
> function page:hello ( $data as element() ) 
>   as element() { $data };
> 
> But I get this instead:
> 
> TIA for any help,
> Robert.



Re: [basex-talk] inspect:functions#1 on XPath funcs errors out with [XPST0003] and returns an XHTML file

2019-05-06 Thread Michael Seiferle
Hi Andreas, 

I think you are calling the inspect function function on the following HTML 
Page: 
https://www.w3.org/2005/xpath-functions/ 

Per documentation, the function does the following:
> If a $uri is specified, the addressed module will be compiled, and its 
> functions will be added to the query context and returned to the user


As the URI contains no XQuery module, the function will error.

Currently inspect:functions only works on user-defined modules.



Hope this helps!

Michael 

> Am 06.05.2019 um 02:47 schrieb Andreas Mixich :
> 
> Hi,
> 
> opening a new sheet in the GUI I just executed:
> 
> inspect:functions("http://www.w3.org/2005/xpath-functions 
> ")
> 
> and this is what I got:
> 
> Error:
> Stopped at http://www.w3.org/2005/xpath-functions 
> , 1/6:
> [XPST0003] Processing instruction has illegal name: xml.
> 
> Optimized Query:
> inspect:functions("http://www.w3.org/2005/xpath-functions 
> ")
> 
> The Query itself is, as returned by BaseX, interestingly, an XHTML file, 
> which seems to have been produced via Saxon, here are the first lines:
> 
> 
> 
> http://www.w3.org/1999/xhtml " 
> lang="EN">
>   
> 
> XQuery, XPath, and XSLT Functions and Operators Namespace Document 
> 
> 
>  
>  href="http://www.w3.org/StyleSheets/TR/base.css 
> "/>
>   
>   
> 
>   
> http://www.w3.org/ ">
>   http://www.w3.org/Icons/w3c_home 
> " alt="W3C" height="48" width="72"/>
> 
>   
>   XQuery, XPath, and XSLT Functions and 
> Operators Namespace Document 
>   21 March 2017
> 
> 
>   Table of Contents 
>   
> 
>   
> 1 
> Introduction
>   
>   
> 
> 
> 
> And here is the QueryPlan:
> 
> Query Plan:
> 
>   
> http://www.w3.org/2005/xpath-functions 
> 
>   
> 
> 
> -- 
> Minden jót, all the best, Alles Gute,
> Andreas Mixich



Re: [basex-talk] A Tail Call, that runs (not) if different numeric values are being used as parameter

2019-05-02 Thread Michael Seiferle
Hi Andreas, 

maybe you might want to share your `string`-Module with us?
I don’t think the swapped version is end-recursive either (due to the concat) 
but it would be interesting to see what happens either way!

Best from Konstanz
Michael

Re: [basex-talk] my first baseX db

2019-04-18 Thread Michael Seiferle
Hi Robert,
are you sure your XML file is valid?
Does it work if you move that particular file out of your google drive 
temporarily?

Best
Michael

Von meinem iPhone gesendet

> Am 18.04.2019 um 21:36 schrieb Robert Kirkpatrick :
> 
> Hello,
> 
> Novice, newbie request: GUI snapshot:
> 
> Command:
> CREATE DB science C:/Users/rober/Google Drive/science/
> Error:
> "Configurations2/accelerator/current.xml" (Line 1): Premature end of file.
> 
> TIA,
> Robert.


Re: [basex-talk] Write functions in sequence

2019-03-12 Thread Michael Seiferle
Hi Guiseppe,


actually the file-operations are non-deterministic and thus (1) never executed 
out of order and (2) even executed if you would not return their results ($o, 
$o2, $o3) and thus might be removed by the compiler.
(Christian might correct me if I am wrong ;-))

I came up with the following example that waits 2 seconds before actually 
writing to $o2:
> let $o :=  file:create-dir("foo")
> let $o2 := file:write("foo/file1.xml", 
>   (function(){
> prof:sleep(2000),
> "Written to File1.xml"
>   })()
>  )
> let $o3 := file:write("foo/file2.xml", file:read-text("foo/file1.xml"))
> 
> return file:read-text("foo/file2.xml“)
So most probably your example does not fully reflect what’s actually happening 
— maybe you could provide some more context?
If you want to, you may even send your query to me directly so you won’t have 
disclose it on this mailing list. 


Best from Konstanz

Michael 



> Am 12.03.2019 um 11:44 schrieb Giuseppe G. A. Celano 
> :
> 
> let $o :=  file:create-dir("/Users/mycomputer/prova")
> let $o2 := file:write("/Users/mycomputer/prova/file1.xml", "ciao")
> let $o3 := file:write("/Users/mycomputer/prova/file2.xml", 
> file:read-text("/Users/mycomputer/prova/file1.xml"))
> return
> ($o, $o2, $o3)
> 
> This actually works. In my real example the writing of $o2 requires e few 
> seconds. It might be that $o3 is evaluated while $o2 is still running?
> 
> Dr. Giuseppe G. A. Celano
> DFG-project leader <http://gepris.dfg.de/gepris/projekt/408121292>
> Universität Leipzig
> Institute of Computer Science, NLP
> Augustusplatz 10
> Tel: +4934132223
> 04109 Leipzig
> Deutschland
> 
> E-mail: cel...@informatik.uni-leipzig.de 
> <mailto:cel...@informatik.uni-leipzig.de>
> Web site 1: http://asv.informatik.uni-leipzig.de/en/staff/Giuseppe_Celano 
> <http://asv.informatik.uni-leipzig.de/en/staff/Giuseppe_Celano> 
> Web site 2: https://sites.google.com/site/giuseppegacelano/ 
> <https://sites.google.com/site/giuseppegacelano/>
> 
>> On Mar 12, 2019, at 11:27 AM, Michael Seiferle > <mailto:m...@basex.org>> wrote:
>> 
>> Hi Guiseppe, 
>> 
>> The following pattern is supposed to / does work:
>>> file:write("1.txt", "Written to 1.txt"),
>>> file:write("2.txt", file:read-text("1.txt")),
>>> "Read from 2.txt: " || file:read-text('2.txt')
>> 
>> 
>> Could you maybe elaborate a bit more on your code?
>> 
>> Best from Konstanz
>> 
>> Michael 
>> 
>>> Am 12.03.2019 um 11:19 schrieb Giuseppe G. A. Celano 
>>> >> <mailto:cel...@informatik.uni-leipzig.de>>:
>>> 
>>> Hi
>>>  
>>> I wrote a single script which should do: write a file -> open this file -> 
>>> write another different file. I put the write expressions in the right 
>>> sequence, but it seems that the second one cannot happen because the file 
>>> created by the first write function has not yet been created at the time 
>>> the second function is invoked. Does anyone have a suggestion about this? 
>>> Thanks.
>>> 
>>> Best,
>>> Giuseppe
>> 
> 



Re: [basex-talk] Write functions in sequence

2019-03-12 Thread Michael Seiferle
Hi Guiseppe, 

The following pattern is supposed to / does work:
> file:write("1.txt", "Written to 1.txt"),
> file:write("2.txt", file:read-text("1.txt")),
> "Read from 2.txt: " || file:read-text('2.txt')


Could you maybe elaborate a bit more on your code?

Best from Konstanz

Michael 

> Am 12.03.2019 um 11:19 schrieb Giuseppe G. A. Celano 
> :
> 
> Hi
>  
> I wrote a single script which should do: write a file -> open this file -> 
> write another different file. I put the write expressions in the right 
> sequence, but it seems that the second one cannot happen because the file 
> created by the first write function has not yet been created at the time the 
> second function is invoked. Does anyone have a suggestion about this? Thanks.
> 
> Best,
> Giuseppe



Re: [basex-talk] Class 'BaseXHTTP' missing?

2019-02-28 Thread Michael Seiferle
Hi Jan, 

I think it would be best to use the ZIP distribution, if you check out the 
sources you have to make sure to compile all maven projects (BaseXHTTP is part 
of the bases-api package).

The ZIP distribution will contain a script to call basexhttp that will load 
both BaseX & basex-api in the classpath  :-)
Hope this helps!

Best from Konstanz

Michael 

Re: [basex-talk] Activating gzip compression

2019-02-27 Thread Michael Seiferle
Hi Omar, 

I can not get it to work either, yet: 
>> * No content-encoding is specified by the resource
>> 
>> I found no way to not specify an encoding for whatever I return in RESTXQ. 
>> If I don't specify anything it's UTF-8. it shows up as "; 
>> character-set=UTF-8"I did not find a way to specify no encoding. Maybe 
>> unrelated but perhaps that is a problem.
>> 
>> 

Content-Encoding denotes how the content has been encoded (gzip, deflate, etc.) 
=> https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding 
 
that’s not the character encoding (such as UTF8).
So the GZIP handler not working correctly is most probably not due to the UTF8 
Encoding you are seeing.


Actually I did not get the GzipHandler working, even using the DefaultServlet ( 
=> requests to /static) instead of BaseX’ RestXQServlet and I found this 
comment that states:
> https://stackoverflow.com/questions/38635262/jetty-9-and-gziphandler 
> The 
> implementation of Gzip support in Jetty is now based on a Container HTTP 
> Output Interceptor pattern. This means GzipHandler has to be defined at a 
> point in the Jetty Handler tree before your WebApp and its WebAppContext even 
> exists.
> 
> 

I’m by no means an expert on servlets, so my conclusions might be wrong! 

Best
Michael



> Am 26.02.2019 um 18:27 schrieb Omar Siam :
> 
> Hi,
> 
> I tried both ways of enabling gzip compression for JSON and js (and others). 
> I can't see it actually working. The GzipFilter method from the web.xml 
> sample seems to be deprecated with a warning of "it is bug ridden" ... But 
> then in a browser debugger I cannot see it actually zipping anything.
> 
> I trief to enable this in my BaseX 9.1.2 instance using
> 
>   
> GzipFilter
> org.eclipse.jetty.servlets.GzipFilter
> 
>   mimeTypes
>   
> text/html,text/xml,text/ecmascript,application/xhtml+xml,application/json,application/javascript,image/svg+xml
> 
>   
>   
> GzipFilter
> /*
>   
> The GzipHandler method seems to get loaded but then also in a browser 
> debugger I cannot see it actually zipping anything.
> 
> For the GzipHandler the documentation 
> https://www.eclipse.org/jetty/documentation/current/gzip-filter.html 
>  talks 
> about when it actually gets invoked and mentions:
> 
> * No content-encoding is specified by the resource
> 
> I found no way to not specify an encoding for whatever I return in RESTXQ. If 
> I don't specify anything it's UTF-8. it shows up as "; character-set=UTF-8"I 
> did not find a way to specify no encoding. Maybe unrelated but perhaps that 
> is a problem.
> 
> I modified webapp/WEB-INF/jetty.xml like this so it uses the GzipHandler 
> (copied from the current jetty distribution):
> 
> 
>   
>   
> ...
>   
>   
> 
>class="org.eclipse.jetty.server.handler.gzip.GzipHandler">
>  deprecated="gzip.minGzipSize" default="2048"/>
>  deprecated="gzip.checkGzExists" default="false"/>
>  name="jetty.gzip.compressionLevel" deprecated="gzip.compressionLevel" 
> default="-1"/>
>  name="jetty.gzip.inflateBufferSize" default="0"/>
>  name="jetty.gzip.deflaterPoolCapacity" default="-1"/>
>  default="false" />
> 
> 
>   
>  deprecated="gzip.excludedUserAgent" default=".*MSIE.6\.0.*"/>
>   
> 
> 
>  name="jetty.gzip.includedMethodList" default="GET" />
>  name="jetty.gzip.excludedMethodList" default="" />
> 
>   
> 
>   
> 
> I hope there is a way to get this to work.
> 
> Best regards
> 
> Omar Siam
> 
> 
> 



Re: [basex-talk] following-sibling axis

2019-02-27 Thread Michael Seiferle
Hi Mark, 

as Martin already stated, the '-w‘-Option has to be active at import time, 
otherwise the whitespace will be chopped. 

If I were to do it, I’d reindex all data and explicitly mark all elements that 
should preserve whitespace, if this is not an option I’d reindex all data with 
whitespace chopping set to off.

Looking forward to your example, I am sure we can figure this out :-)

Best
Michael




> Am 26.02.2019 um 18:52 schrieb Mark Bordelon :
> 
> A follow-up:  starting basex -w does NOT seem to solve completely my issue 
> after all. Real data (more complicated than the simplified example) still 
> does not query correctly: text nodes from after later elements are displayed 
> in the place of null text nodes.
> I’ll try to get a better example, still simplified, that shows this.



Re: [basex-talk] supporting XML Catalog files in xslt:transform() (patch)

2019-02-27 Thread Michael Seiferle
Dear Liam, 

Thanks a lot for this Patch, this issue has been open for quite some time ;-)
As Christian is currently on holidays and will only return next week, I added a 
Pull Request on GitHub https://github.com/BaseXdb/basex/pull/1667 
 so the patch won’t be lost.


Feel free to resubmit that PR if you’d like to have the correct author info in 
the git history, currently it is misattributed to me!


Thanks again!

Best from Konstanz

Michael

Re: [basex-talk] following-sibling axis

2019-02-26 Thread Michael Seiferle
Hi Mark, 
Hi Martin,

yes Martin is right, the whitespace will be chopped by default leading to the 
observed behavior.

If you wanted to preserve whitespace globally, you can do that when creating 
your database. 
If you only want to preserve whitespace for a given element you may do this as 
well:

> let $db := 
> '
>   
> Aa
> B
> Cc
>   
> ' => parse-xml() (: have to actually parse it for the whitespace 
> preserve to have a an effect :)
> 
> return $db//word/concat(text(), ' ', 
> normalize-space(./following-sibling::text()[1]))

Which returns: 
> A a
> B 
> C c


Best
Michael

> 
> Am 26.02.2019 um 09:48 schrieb Martin Honnen :
> 
> 
> I think the result you get is caused by whitespace chopping during XML 
> parsing, seems to be the default, 
> seehttp://docs.basex.org/wiki/Command-Line_Options 
> 
> -wToggles whitespace chopping of XML text nodes. By default, whitespaces 
> will be chopped.
> 
> 
> 



Re: [basex-talk] geo:distance() return units

2019-02-26 Thread Michael Seiferle
Hi Jacob, 

well — the geo distance computes the distance of the direct line between the 
two coordinates:
>52.519881,13.407338
and
>51.507351,-0.12766

Which happens to be 13.57281797796  <=> 
https://en.wikipedia.org/wiki/Euclidean_distance

Yet, the earth is spherical, so you need to take that into account, 
https://en.wikipedia.org/wiki/Geographical_distance 
<https://en.wikipedia.org/wiki/Geographical_distance>

I think what you are actually looking for is the great-circle distance — the 
length of a line traveling along the surface between two points on a circle.

A somehow good approximation for that distance can be computed using the 
haversine formula:
http://www.movable-type.co.uk/scripts/latlong.html 
<http://www.movable-type.co.uk/scripts/latlong.html>

I rewrote the Javascript as XQuery and the result seems to be about right.

> import module namespace geo = "http://expath.org/ns/geo;;
> declare namespace gml='http://www.opengis.net/gml';
> 
> 
> (: formula taken from here: 
>   https://www.movable-type.co.uk/scripts/latlong.html
> :) 
> declare function local:haversine(
>   $point1 as element(gml:Point),
>   $point2 as element(gml:Point)
> ) as xs:double {
>   let $r:= 6371  (: earth radius in KM :)
>   let $lat1 := geo:x($point1)
>   let $lat2 := geo:x($point2)
>   let $lon1 := geo:y($point1)
>   let $lon2 := geo:y($point2)
>   let $φ1   := $lat1 => local:radians()
>   let $φ2   := $lat2 => local:radians()
>   let $Δφ   := ($lat2 - $lat1) => local:radians()
>   let $Δλ   := ($lon2 - $lon1) => local:radians()
> 
>   let $a:= math:pow(math:sin($Δφ div 2), 2) +
>math:cos($φ1) * math:cos($φ2) *
>math:pow(math:sin($Δλ div 2), 2)
>   let $c   := 2 * math:asin(math:sqrt($a))
>   
>   return $c * $r
> };
> 
> 
> declare function local:radians(
>   $deg as xs:double
> ) as xs:double {
>   $deg * (math:pi() div 180)
> };
> 
> 
> let $berlin :=
>  
>52.519881,13.407338
>  
> let $london :=
>  
>51.507351,-0.12766
>  
> return local:haversine($berlin, $london)
> (: returns 931.7188794140812 :)



Maybe you should make yourself comfortable with the maths behind that formula 
to better understand its shortcomings, nevertheless, here’s what I came up with 
in a more readable version:

https://gist.github.com/micheee/e47166d0947f925e395504c1e220fbea 
<https://gist.github.com/micheee/e47166d0947f925e395504c1e220fbea>

Best
Michael






> Am 26.02.2019 um 13:19 schrieb Jacob Borisov :
> 
> Hi! For example, it's need to get the distance between Berlin and
> London, which is 934 km.
> 
> So I've put the coordinates as they can be found in Google Maps, etc.:
> 
> let $berlin :=
>  
>52.519881,13.407338
>  
> let $london :=
>  
>51.507351,-0.12766
>  
> return geo:distance($berlin, $london)
> 
> And the result is 13.57281797796
> 
> Also I had trying to change srsName attribute of gml:Point's to
> different values like "3857", "EPSG:3857" (it's uses meter units as
> mentioned here https://epsg.io/3857), but practically this changes
> nothing. Thanks.
> 
> вт, 26 февр. 2019 г. в 19:33, Michael Seiferle :
>> 
>> Hi Jacob,
>> 
>> I’ve never really used the geo:module but according to the documentation:
>>> in the units of the spatial reference system of geometry1
>> If I understand it correctly, you would have to convert your coordinates to 
>> map them to miles or kilometers for example.
>> 
>> Maybe you can provide an example?
>> 
>> Given this very simple query:
>>> import module namespace geo = "http://expath.org/ns/geo;;
>>> declare namespace gml='http://www.opengis.net/gml';
>>> let $point1 :=1,1
>>> let $point2 := 2,2
>>> return geo:distance($point1, $point2)
>> 
>> The result is math:sqrt(2),  the length of a straight line from P(1,1) — 
>> P’(2,2) but this length does not contain any unit of measurement.
>> 
>> 
>> 
>> Best
>> Michael
>> 
>> 
>> 
>>> Am 26.02.2019 um 12:12 schrieb Jacob Borisov :
>>> 
>>> Hello. Could anybody explain how to get a result from geo:distance()
>>> in kilometers or miles? Thanks.
>> 



Re: [basex-talk] geo:distance() return units

2019-02-26 Thread Michael Seiferle
Hi Jacob,

I’ve never really used the geo:module but according to the documentation:
> in the units of the spatial reference system of geometry1
If I understand it correctly, you would have to convert your coordinates to map 
them to miles or kilometers for example.

Maybe you can provide an example? 

Given this very simple query: 
> import module namespace geo = "http://expath.org/ns/geo;;
> declare namespace gml='http://www.opengis.net/gml';
> let $point1 :=1,1
> let $point2 := 2,2
> return geo:distance($point1, $point2)

The result is math:sqrt(2),  the length of a straight line from P(1,1) — 
P’(2,2) but this length does not contain any unit of measurement. 



Best
Michael



> Am 26.02.2019 um 12:12 schrieb Jacob Borisov :
> 
> Hello. Could anybody explain how to get a result from geo:distance()
> in kilometers or miles? Thanks.



Re: [basex-talk] Stack Overflow: Try tail recursion

2019-02-19 Thread Michael Seiferle
Hi Guiseppe, 


unfortunately the example won’t be tail-call optimized as your last statement 
is not the function call itself but a sequence construction that happens to 
contain the function call.

Your function must be of the form:

> f(x) => s(x)if your termination condition is met (i.e. no more books)
> f(x) => f(g(x))

Your function is defined (more or less) as something like:
> f(x) => s(x)if your termination condition is met (i.e. no more books)
> f(x) =>  something  +  f(g(x))

So you have to get that something (i.e. the sequence concatenation) part inside 
your g-function, here’s what I think you might want:

Cross-posted as gist for better readability 
https://gist.github.com/micheee/ef75c9f30449c2de3406182ff2fdce50 
 
>   declare variable $bookstore := {
> for $i in 1 to 30
> return element book {
>   element name {
> "Book " || $i
>   },
>   element price {
> 1
>   },
>   element author {
> "Author "|| $i
>   }
> }
>   }
>   ;
>   
>   (:~ 
>   Rolling total of prices
>   @param $prices, accumulates the book prices.
>  $prices[$n] contains the sum of prices for $book[position() <= $n]
>   @param $books sequence of books not yet added to $prices
>   :)
>   declare function local:sum($prices, $books)
>   {
>   let $book   := head($books)   (: Get first book in sequence :)
>   let $prices := if(count($prices) = 0) (: if empty, initialize prices 
> with first price :)
> then ($book/price )   
> else ((: add the current rolling total to the 
> list of rolling totals :)
>   (: that’s the concatenation part :)
>   $prices,
>   element price { $prices[count($prices)] + $book/price } 
> )  
>   return (
> if(count($books) > 1) then 
>   local:sum($prices, tail($books))  (: here's the tail call :)
> else $prices
>   )
>   };
>   
>   
>   {
>   local:sum((), $bookstore/book) 
>   }
>   

You can check if your query is tail-call optimized using the query info panel: 
> - mark as tail call: local:sum(if(empty($prices_2)) then (hea...



Hope this helps!

Best from Konstanz

Michael

> Am 18.02.2019 um 19:12 schrieb Giuseppe G. A. Celano 
> :
> 
> Hi Jonathan, 
> 
> Thanks for that. However, it returns the same stack overflow error as the 
> other script, when  are 38000.  Encreasing the JVM size does not help 
> either.
> 
> E-mail: cel...@informatik.uni-leipzig.de 
> 
> Web site 1: http://asv.informatik.uni-leipzig.de/en/staff/Giuseppe_Celano 
>  
> Web site 2: https://sites.google.com/site/giuseppegacelano/ 
> 
> 
>> On Feb 18, 2019, at 4:51 PM, Jonathan Robie > > wrote:
>> 
>> To make it tail-recursive, make the recursive call the last operation in the 
>> function.
>> 
>> https://en.wikipedia.org/wiki/Tail_call 
>> 
>> 
>> The else() clause is what keeps it from being tail recursive.  Something 
>> like this should work:
>> 
>> declare variable $bookstore := 
>>   
>> story
>> 50.00
>> smith
>>   
>>   
>> history
>> 150.00
>> kelly
>>   
>>   
>> epic
>> 300.00
>> jones
>>   
>> ;
>> 
>> declare function local:sum($books, $sum)
>> {
>> let $sum :=  $sum + $books[1]/price
>> return (
>> { $sum },
>> $books[2] ! local:sum(tail($books), $sum)
>> )
>> };
>> 
>> 
>> {
>> local:sum($bookstore/book, 0)
>> }
>> 
>> 
>> 
>> Jonathan
>> 
>> On Mon, Feb 18, 2019 at 10:24 AM Giuseppe G. A. Celano 
>> mailto:cel...@informatik.uni-leipzig.de>> 
>> wrote:
>> I am writing a recursive function which is similar to the one here:
>> 
>> https://stackoverflow.com/questions/27702718/to-add-values-in-cumulative-format
>>  
>> 
>> 
>> Interestingly, local:sum() works if there are not many . However with 
>> 38000 book element I get the error "Stack Overflow: Try tail recursion".
>> 
>> Any idea?
>> 
>> Ciao,
>> Giuseppe
>> 
>> 
> 



Re: [basex-talk] Docker Volumes Permission denied

2019-02-19 Thread Michael Seiferle
Hi Marie, 

thanks a lot for the follow up.
Happy to hear it’s working!

Best
Michael

Re: [basex-talk] Docker Volumes Permission denied

2019-02-14 Thread Michael Seiferle
Hi Marie, 

thanks for your observations!

The explanation for this behavior is, that the `basexhttp` Process inside the 
container runs as non-privileged user `basex` with an UID of 1984 & GID 0.
Usually processes inside docker containers will run as root and as such will be 
able to read & write from all volumes you mount *inside* your container.
Currently `basexhttp` does not do that.
It mounts your directory from your host OS as a volume insider your container, 
yet the fie/folder it still belongs to its original user (in your case UID 
1000) but from inside the running docker image, a USER with UID 1984 wants to 
write to it. This fails.

Basically: 
>  chown -R 1984 ~/Projects/Architextus/basex-xquery-server/data

Should make your data directory writable to that process — and if it were group 
writable it is still writable by your host OS.
As you write repo & webapp  from the host os only, there is no need to change 
ownership on those folders.

* Another approach I/we usually take is building my own docker image derived 
from basexhttp and ADD my project to the image.

> FROM basex/basexhttp
> ADD ./webapp /srv/basex/webapp
> ADD ./repo /srv/basex/repo
> ADD ./data /srv/basex/data



Any thoughts on this by other docker users? Lot’s of containers run privileged, 
but I am not sure if we really want this.




Let me know if you  need any more help!

Michael






> Am 12.02.2019 um 14:42 schrieb Marie Starck :
> 
> Hello everyone,
> 
> So I am looking to add Docker to a BaseX webapp that is currently running 
> properly on my local. In order to do that, I ran
> docker run -ti -d
> --publish 1984:1984
> --publish 8984:8984
> --volume ~/Projects/Architextus/basex-xquery-server/data:/srv/BaseXData
> --volume ~/Projects/Architextus/basex-xquery-server/webapp:/srv/BaseXWeb
> --volume ~/Projects/Architextus/basex-xquery-server/repo:/srv/BaseXRepo
> basex/basexhttp:8.6.4
> 
> And while localhost:8984 shows me the regular BaseX introduction page, none 
> of the rest endpoints work and I get this error when I try to access the 
> webapp from my localhost:
> 
> Stopped at /srv/BaseXWeb/xqm/g-holismo.xqm, 136/24:
> [bxerr:BXDB0002] Resource "/srv/BaseXData/DITA-AppResources/tbl.basex 
> (Permission denied)" not found.
> 
> Stack Trace:
> - /srv/BaseXWeb/xqm/g-holismo.xqm, 11/10
> 
> I checked the permissions on my docker container and it seems that the basex 
> user only has permissions on WEB-INF but none of the volumes, BaseXData, 
> BaseXRepo and BaseXWeb, those are shown as belonging to user 1000.
> 
> Has anyone experienced this before?
> 
> Thank you for any help or tip you could provide,
> 
> Marie
> 



Re: [basex-talk] ubuntu 18.04 (bionic)

2019-01-31 Thread Michael Seiferle
Hi,

feel free to use the ZIP-file provided at
http://files.basex.org/releases/9.1.2/ it should be up to date :)


Best
Michael


On Thu, Jan 31, 2019 at 10:23 AM Ветошкин Владимир 
wrote:

> Hi!
>
> There is only 8.5.1 version for Ubuntu 18.04 at url
> https://launchpad.net/basex/+packages
> <https://launchpad.net/basex/+packages)>
> Is there 9 version for that Ubuntu ?
>
> Thx
>
> --
> С уважением,
> Ветошкин Владимир Владимирович
>
>


-- 
--
Michael Seiferle, BaseX GmbH, http://basex.org
|-- Firmensitz: Obere Laube 73, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Fon: +49 7531 28 28 676, Fax: +49 7531 20 05 22


Re: [basex-talk] Strange response from Docker BaseXDBA

2018-12-07 Thread Michael Seiferle
Hi Huib, 

Thanks for the pointer to stackoverflow, I missed that one!
I added an answer over there: 
https://stackoverflow.com/questions/53462688/docker-basex-dba/53667345#53667345 

 — his problem somehow unrelated to your problem as the question refers to an 
older DBA version.

However the solution presented there should work well.
The docker build in our root folder will not add the DBA, so that’s most 
probably the issue?
> I did a "docker build -t basexdba ." in de root of the source folder of BaseX 
> as per the DBA example in http://docs.basex.org/wiki/Docker.

You may validate if the dba folder is present in your running container via 
`docker exec $CONTAINER-ID` — you can find the container id using `docker ps`:

Below I have to containers, one contains  the dba folder, the other does not.

> michael@mbp:~/tmp|⇒  docker exec 99f650b42036 ls '/srv/basex/webapp'
>> WEB-INF
> michael@mbp:~/tmp|⇒  docker exec 3a4eb9927c90 ls '/srv/basex/webapp'
>> WEB-INF
>> chat
>> dba
>> restxq.xqm
>> static


Hope this helps! Let me know if I can shed some more light on this issue!

Best
Michael

> Am 06.12.2018 um 13:29 schrieb Christian Grün :
> 
> Hi Huib,
> 
> I’ve never tried our docker images, but as far as I know, the last DBA
> docker images are based on 8.5.4. Are you still working with BaseX 8?
> 
> Best,
> Christian
> 
> 
> 
> On Thu, Nov 29, 2018 at 5:29 PM Huib Verweij  wrote:
>> 
>> Hi,
>> 
>> I have a strange case of receiving a “No function found that matches the 
>> request” message from BaseXDBA.
>> 
>> I did a "docker build -t basexdba ." in de root of the source folder of 
>> BaseX as per the DBA example in http://docs.basex.org/wiki/Docker.
>> 
>> I got a basexdba:latest image and started it with “docker run -p 8984:8984 
>> basexdba:latest”.
>> 
>> According to the documentation I should get the dba page with: 
>> http://localhost:8984/dba but the server returns "No function found that 
>> matches the request.".
>> 
>> There’s also a recent question on Stackoverflow about this: 
>> https://stackoverflow.com/questions/53462688/docker-basex-dba/53543130#53543130
>> 
>> Regards,
>> 
>> Huib.



Re: [basex-talk] Strategies for using BaseX & friends as XML CMS?

2018-08-14 Thread Michael Seiferle
Hi Andreas,

I don’t think there are many out of the box solutions to this, despite 
document-level locking in our webdav-implementation.

We have however worked on an oxygen-based solution, together with axxepta GmbH, 
called Argon Author: http://argon-author.com 
There is support for checkout/checkin/locking as well as a per file history all 
implemented in plain XQuery that might serve as a starting point for 
implementation/discussion :-)

Best from Lake Constance
Michael





> Am 09.08.2018 um 17:54 schrieb Andreas Jung :
> 
> Hi there,
> 
> we are currently investigating options for using XML database as a backend in 
> a publishing project
> related to technical documentation - DITA in particular. The broad customer 
> requirements are
> checkin and checkout of documents, locking of documents and versioning. Has 
> anyone worked with
> an XML database in similar scenarios? Any pointers?
> 
> Andreas



Re: [basex-talk] Nugets?

2018-06-08 Thread Michael Seiferle
Hi Radim, hi Dirk, hi Peter,

in my opinion  offering nuget packages might at least be worth investigating, 
if we were able to automate their creation I sure don’t have any objections! 

After (briefly) reading the documentation at 
https://docs.microsoft.com/en-us/nuget/what-is-nuget 
 I think shipping a 
precompiled version of our c# client (including version information, license 
information etc.)
would already help Peter, Radim and their teams in using our client, right?

If there is mutual interest we could move the discussion to GitHub, I’d be 
grateful if s/o with more .net platform expertise was willing to join the 
actual process or at least provide some pointers in the right direction :-)

Best from Konstanz

Michael



> Am 08.06.2018 um 15:37 schrieb  
> :
> 
> Hello,
> 
> it would be nice to have BaseX as a Nuget package, but I can live without 
> that. It's quite easy to integrate it as-is.
> Regads,
> 
> Radim Havlicek
> C# developer
> 
> -- Původní e-mail --
> Od: Kirsten, Dirk 
> Komu: Peter Villadsen 
> Datum: 8. 6. 2018 12:45:53
> Předmět: Re: [basex-talk] Nugets?
> 
> Hello Peter,
> 
> just my thoughts, and Christian for sure will answer you more politely, but I 
> am quite confused by your email. First of, I (and I am sure many others…) 
> have never heard of Nuget before and saying “engineers expect that” is 
> certainly wrong. It might be true for the C# community, but there are other 
> engineers out there… 
> 
> And given that C# is not a focus of BaseX, but instead only provides a client 
> for your convenience I am not surprised the BaseX team does not support that.
> 
> Also, I have a hard time believing the trivial 302 lines of code of the C# 
> client are that expensive and time consuming to check. Also, the Microsoft 
> internal pre-shipping legal audits seem to be neither the fault nor the 
> responsibility of BaseX. Hey, BaseX is even under the most liberal open 
> source licence, something which can not be said about many Microsoft products 
> (although I appreciate the improvements Microsoft have done in their actions 
> and think regarding open source).
> 
> Given that BaseX is an open source product you are more than welcome to 
> contribute these nuget packages. It is even super-easy, because the BaseX 
> repository is hosted on this Microsoft webplatform GitHub.
> 
> Best regards
> Dirk
> 
> 
> Senacor Technologies Aktiengesellschaft - Sitz: Eschborn - Amtsgericht 
> Frankfurt am Main - Reg.-Nr.: HRB 105546
> Vorstand: Matthias Tomann, Marcus Purzer - Aufsichtsratsvorsitzender: Daniel 
> Grözinger
> 
> On 7. Jun 2018, at 18:55, Peter Villadsen  > wrote:
> 
>  
> Hello,
> I am building a system that relies on a Basex backend, and for that I have 
> chosen to use the TCP protocol. My system is built in managed code, so I went 
> ahead and copied the code provided here: 
> https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23 
>  which 
> satisfied my needs very nicely. However, since I have not written this code 
> myself, it is subject to expensive and time consuming pre-shipping legal 
> audits where it is checked that the code does not contain references to other 
> public domain code. 
>  
> Engineers developing managed code today expect APIs to be shipped as Nuget 
> packages. This has the advantages that it is extremely easy to uptake, you 
> can regard it as a black box (but get the source if you need to), and it 
> supports dependencies (none, in your case) and you can go back and use 
> previously shipped versions (which is important in your case, since you have 
> just changed the authentication scheme I believe). Could  you consider 
> offering the API as both Nugets and source on Github?
>  
>  
> Best Regards
>  
> Peter Villadsen
> Principal Architect
> Microsoft Business Applications Group
> 



Re: [basex-talk] Big Surprise from outputs in version 7.3.1 and 8.6.7 ?

2018-02-02 Thread Michael Seiferle
Hi Bang,

If you export a database its contents will be written to the folder given as an 
argument to the EXPORT command:

EXPORT [path]
> Exports all documents in the database to the specified file path


The `basex.*`-files you are seeing in your data folder are database files.
This is what exporting a database might look like: 
https://asciinema.org/a/QzLcXX93nJIUaOAcjfp94rOOQ 


Step 1: put your database in the `data/${database-name}` folder 
Step 2: OPEN ${database-name}
Step 3: EXPORT ${path}
Step 4: find your (XML)-files in ${path}

(Replace ${foo} with the actual names).

Apart from that http://docs.basex.org/wiki/Databases 
 might be a good read =) 

Best
Michael




> Am 02.02.2018 um 14:03 schrieb Bang Pham Huu :
> 
> Yes, I opened the document
> (http://files.basex.org/releases/7.3/BaseX73.pdf) and it said "EXPORT
> writes all resources to the specified target directory • GUI: Go to
> Database → Export, choose the target directory and press OK".
> 
> But as the BaseX GUI tool cannot open .basex file as database (that is
> why I asked you by listing all the files I have) so the export button in
> drop down database menu is disable.
> 
> Thanks,
> 
> 
> On 02/02/2018 01:56 PM, Christian Grün wrote:
>> Have you found and opened the documentation PDF for BaseX 7.3? Looking
>> for the term "export" should give you some hints.
>> 
>> Best,
>> Christian
>> 
>> 
>> 
>> On Fri, Feb 2, 2018 at 1:36 PM, Bang Pham Huu
>>  wrote:
>>> Hi Christian,
>>> 
>>> I'd do as your suggestion, but I'm stuck with how to export old database
>>> to XML file. I only have these files (no XML):
>>> 
>>> atv.basex   atvr.basex  tbl.basex   txt.basex   txtr.basex
>>> atvl.basex  inf.basex   tbli.basex  txtl.basex
>>> 
>>> and from your link, I tried to download BaseX GUI application
>>> http://files.basex.org/releases/7.3/BaseX73.jar. But this tool seems can
>>> open from XML file only. How can I open these .basex file and convert
>>> to  a XML file?
>>> 
>>> Thanks,
>>> 
>>> 
>>> On 02/02/2018 12:55 PM, Christian Grün wrote:
 Hi Bang,
 
 The general answer on your initial question: BaseX is
 backward-compatible. Older databases can be opened and queried with
 newer versions of BaseX.
 
 This seems to conflict with the experiences you made. But I agree with
 Dirk: It’s difficult to understand what is going wrong in your testing
 environment. It’s not possible to tell why a query should yield
 results that is not contained in the data you provide.
 
 Maybe you could try to proceed step by step and give feedback:
 
 1. Export the database with BaseX 7.3.1. Note that you cannot use all
 the BaseX 8.x syntax with older versions of the software. Please check
 out our documentation history to learn how to proceed [1].
 2. Export the same database with BaseX 8.x.
 3. Compare the resulting output.
 
 If the output of BaseX 7 and 8 differs, then:
 
 4. Ensure that your database directories are really identical.
 5. Report back to us which output you believe is correct: If the
 output of BaseX 7.x is wrong, it may even be due to a bug in the old
 version, or due to some corrupt data that can successfully restored by
 BaseX 8. If the output of BaseX 8.x is wrong, tell us what is missing.
 
 If the output is identical, then:
 
 4. Create a new database from this data with BaseX 8.x.
 5. Run your query and compare the results.
 
 Best,
 Christian
 
 [1] http://docs.basex.org/wiki/Documentation
 
 
 
 
 On Fri, Feb 2, 2018 at 11:48 AM, Bang Pham Huu
  wrote:
> What I tried to say is: I'm using input (old database) which has lot of
> modifications since version 7.3.1 and I could use this database for both
> applications (BaseX 8.6.7 and BaseX 7.3.1 on different systems). But
> application in 8.6.7 can export database (with some missing data),
> application in 7.3.1 cannot export database (error).
> 
> If it is hard to understand, sorry about it. I shouldn't have asked this
> question if one database is queried with same queries on both version 
> BaseX
> 8.6.7 and BaseX 7.3.1 could return different results.
> 
> So, now, actually I couldn't provide you a valid test input ("Your input 
> XML
> (using BaseX 8.6.7)") because as you saw that in exported db from an
> application using BaseX 8.6.7 on this olddatabase, the data is missing and
> you questioned about it.
> 
> "The expected result and how it differs from what you expect", I'd say it
> should be the same from application using BaseX version 7.3.1 as my first
> email (it can be replaced from "\n" to " ", it is ok).
> 
> I asked because I just want to 

Re: [basex-talk] xml element beginning and end space loss

2018-02-01 Thread Michael Seiferle
Hi Stefania,

Sorry for the delay.

If I run you example, I **think** it behaves as intended, all -Elements but 
the one marked with xml:space are chopped.

This is what it looks like here: 
> https://asciinema.org/a/4v1FtkeE1QsEByHe1S2BAZP9W

> michael@mbp:~/tmp/ml|⇒  cat example.xq
> db:create('test',
> "
> stefy  
> stefy  
> stefy  
> ",
> "doc.xml"
> )
> michael@mbp:~/tmp/ml|⇒  basex example.xq
> michael@mbp:~/tmp/ml|⇒  basex "db:open('test')"
> 
>   stefy
> stefy  
>   stefy
> %

…if I add CHOP=false, the whitespace will be kept on all elements:
https://asciinema.org/a/IqUHE2hrhk0afjbPDi3jMgNVq 
<https://asciinema.org/a/IqUHE2hrhk0afjbPDi3jMgNVq>

I am sure we will eventually be able to solve this mystery :-)

Best
Michael

> Am 30.01.2018 um 23:36 schrieb Stefania Axo <st...@us.ibm.com>:
> 
> thanks  Michael
> 
> I run your suggestion and it seems to affect all the elements on my BaseX.
> I also verified that the 'chop' property was still true after the execution 
> of the xquery 
> (> open test
> Database 'test' was opened in 7.29 ms.
> > get chop
> CHOP: true)
> 
> db:create('test',
> "
> stefy  
> stefy  
> stefy  
> ",
> "doc.xml"
> ) 
> >>>>>
>stefystefy  
> stefy 
> 
> 
> 
> 
> db:replace("test", "doc1.xml",
> "
> stefy  
> stefy  
> ")
> >>>>>
>stefy 
> stefy 
> 
> 
> Am i missing something?
> thanks
> Stefania
> 
> 
> 
> From:Michael Seiferle <m...@basex.org>
> To:Gerrit Imsieke <gerrit.imsi...@le-tex.de>, st...@us.ibm.com
> Cc:BaseX <basex-talk@mailman.uni-konstanz.de>
> Date:01/29/2018 11:22 AM
> Subject:Re: [basex-talk] xml element beginning and end space loss
> 
> 
> 
> Hi & thanks Gerrit,
> Hi Stefania,
> 
> You may even decide to chop-or-not on a per-element basis:
> db:create('test',
> "
> stefy  
> stefy  
> ",
> "doc.xml"
> )
> 
> Will preserve whitespace in the second -Element while chopping in the 
> first one.
> => http://docs.basex.org/wiki/Options#CHOP 
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__docs.basex.org_wiki_Options-23CHOP=DwMFAg=jf_iaSHvJObTbx-siA1ZOg=oRDtJNjvHAlLIcU_p2eWUQ=AIHTeBAo5MBiXhmnxUdQi_GxNJ60DZKWMN9ThNZO0J4=LdABq3glFtOe8YafyHOrMcDLENoIHMUkyZuepDsyamQ=>
> 
> 
> Best from Konstanz :-]
> 
> Michael
> 
> Am 27.01.2018 um 01:06 schrieb Imsieke, Gerrit, le-tex 
> <gerrit.imsi...@le-tex.de <mailto:gerrit.imsi...@le-tex.de>>:
> 
> Luckily you can switch it off.
> 
> 
> 



Re: [basex-talk] xml element beginning and end space loss

2018-01-29 Thread Michael Seiferle
Hi & thanks Gerrit,
Hi Stefania,

You may even decide to chop-or-not on a per-element basis:
> db:create('test',
> "
> stefy  
> stefy  
> ",
> "doc.xml"
> )

Will preserve whitespace in the second -Element while chopping in the 
first one.
=> http://docs.basex.org/wiki/Options#CHOP 



Best from Konstanz :-]

Michael

> Am 27.01.2018 um 01:06 schrieb Imsieke, Gerrit, le-tex 
> :
> 
> Luckily you can switch it off.



Re: [basex-talk] Special Character Search - @, $,#

2018-01-24 Thread Michael Seiferle
Hi Navin,

these characters are not searchable by the full-text-index.
@$# and other special-characters are treated as word-breakers[1] and can’t be 
searched for.

If you ran for example the following query:
> ft:tokenize("f...@bar.de#test$baz“)
You will see which tokens will be added to the full-text-index.
The full-text-index is usually used to search in natural language texts, so 
punctuation und special characters are generally ignored.

Maybe a naïve approach already helps: 
> db:open(‚database')//text()[contains(., "@")]/..


Best from Konstanz,

Michael


[1] https://www.w3.org/TR/xpath-full-text-10/ 
<https://www.w3.org/TR/xpath-full-text-10/>

--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Obere Laube 73, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Tel: +49 7531 916 82 77

> Am 24.01.2018 um 10:42 schrieb Navin Rawat <nrawat2...@gmail.com>:
> 
> Hi Team,
> 
> Could I search @, $, # by full text API of bases?
> 
> I am using following query but unable to get any success:
> 
> let $query := '@'
> let $options := map {
> "mode": "any",
> "fuzzy": "off",
> "wildcards": true(),
> "ordered": "false"
> }
> return ft:search("database", $query, $options)
> 
> Please suggest.
> 
> Regards,
> Navin



Re: [basex-talk] XML + HTML to JSON

2017-12-14 Thread Michael Seiferle
Hi Max, 

I am not aware of any direct way, but you might consider the following:

https://gist.github.com/micheee/c5a55ca8b49435934c006cfc5df7ba0f


What it does: 

1. Replace the contents of xhtml with its string serialization
2. Wrap the info node in an element named json, according to our own JSON 
serialization format
3. Serialize the contents as JSON.
…to go back:
4. Serialize the JSON as XML
5. Remove our JSON-Mapping Attributes
6. Replace the value of the element with its (parse:html() in case it is a 
valid document with a single root node) parse-xml-fragment() contents.


Hope this kind of helps ;)

Michael


--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Obere Laube 73, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Tel: +49 7531 916 82 77

> Am 14.12.2017 um 16:16 schrieb Maximilian Gärber <mgaer...@arcor.de>:
> 
> Hi,
> 
> we've content similar to:
> 
> 
> Foo
> 
>Some para 
> 
> 
> 
> How can I tell the JSON serializer to treat the content of  as html?
> 
> 
> Br,
> 
> Max



Re: [basex-talk] Loading data

2017-11-19 Thread Michael Seiferle
Dear Wray,

I tried to come up with a sketch of what–I think–might help you:
https://gist.github.com/micheee/8a8734a1713a7121cab15eb3dfb389d9

Basically it boils down to:
1. Fetch the JSON
2. Convert that JSON to an XQuery item
3. Iterate over each array entry and explicitly construct the XML 
representation you want


So in a nutshell, in XQuery 3.1, something like the following:
>   
> fetch:text('https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763c704f8ffd3ea9a3e81d25e2c6f6/cities.json')
>   => parse-json()  (: Convert to XQuery item representation :)
>   => array:for-each(function($map){ (: For each entry in that array, do :)
> element item { (: Construct an XML element named item :)
>   $map => map:keys()
>   => for-each(function($key){  (: For each key in the map, do: :)
> element { $key } { (: Return an element named $key :)
>   $map($key)   (: …and the value of $map($key) :)
> }
>   })
> }
>   })
>   => array:flatten() (: Converts the array to a sequence :)


I assume you are using BaseX, so maybe the json:parse() function might be 
another option, that is based on our own implementation and will create an XML 
representation right away:
>   
> fetch:text('https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763c704f8ffd3ea9a3e81d25e2c6f6/cities.json')
>   => json:parse()
For more info on our BaseX JSON-Module see: 
http://docs.basex.org/wiki/JSON_Module


As I can only guess what your XQuery code actually looks like I hope this comes 
somewhat close to what you want.


Hope this helps ;-)

Best from Konstanz

Michael

> Am 19.11.2017 um 06:25 schrieb E. Wray Johnson :
> 
>  I have a JSON file
> https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763c704f8ffd3ea9a3e81d25e2c6f6/cities.json
>  
> 
> 
> I want to load it into a database in a different XML format where I can use 
> gml:Point in place of longitude and latitude as separate elements.  However 
> my for loop does not emit individual XML elements for each json object in the 
> loaded array.
> 



Re: [basex-talk] A few general questions about BaseX

2017-09-12 Thread Michael Seiferle
Hi Anastasiou,

:-)

> Am 12.09.2017 um 10:54 schrieb Anastasiou A. :
> 
> Hello everyone
>  
> I am trying to load BaseX with a large number of XML files (~500), each one a 
> few hundreds of MBs big.
> BaseX fails with a message along the lines “This is too big for one database”.
=> might be that you hit one of our database limits.
See the first line here for general limits: 
http://docs.basex.org/wiki/Statistics 
>  
> Can I please ask:
>  
> 1)  Are there any logs, beyond the DB logs? If yes, where can I find them?
> a.  The reason I am asking is because once basexgui gives the message, 
> there is no indication about the error.
> Ideally, I would like to know if this is a limitation on memory amount or 
> number of items (?).
The database logs are all there is.
You can use the admin module to add your own messages to these logs, 
http://docs.basex.org/wiki/Admin_Module#admin:write-log 


So for example in a try / catch block you could log more explicitly whats 
happening :)

> 
> 2)  The parser options include reading XML files from archives, which is 
> very convenient, but once the file has been 
> parsed, does BaseX require the “originals” for queries / returning results?
If you created a database from your archive, i.e. db:create(‚foo.zip‘,…) the 
original files are no longer needed.
http://docs.basex.org/wiki/Database_Module#db:create 


> 
> 3)  Is it possible to do federation with BaseX? In other words, let’s say 
> I split a database in two large parts (as per #1), 
> is it possible to launch two baseX servers and then have them talk to each 
> other so that ultimately I just query one of 
> them and get back unified results?
> 

Yes, it is possible, but only if you are willing to suffer a little :-)
You can use the http://docs.basex.org/wiki/Client_Module 
 to connect to a running basex server 
and you could use the http://docs.basex.org/wiki/XQuery_Module#xquery:fork-join 
 to connect to 
multiple servers at once, pose a query and return the results.

But expect to do some stuff by hand: i.e.:

- maintain a list of servers you currently have
- handle storing, deleting and updating documents
- handle document retrieval, …

So a probably large bit of manual work is absolutely required, but depending on 
what you need to do with your documents it might work "well enough“ :-)

If you need more information let me know!

Best Michael


> All the best



Re: [basex-talk] Issue with Full Text Retrieval

2017-09-11 Thread Michael Seiferle
Hi Ron,
Hi Fabrice,

Your observation w.r.t. to element boundaries is right, the document is 
converted to a textual representation, by default it returns all nodes in their 
string representation:

$doc :=
> 
>   XQuery 
>   <_>and XPAth
>   <_>are   awesome
> /data()

Will turn to:
> 
>   XQuery 
>   and XPAthare   awesome
>  
So:
> $doc contains text { 'XPath‘ }

will return false.

You have 3.5 options:

1) => as Fabrice showed, query the individual text nodes

2) use the ft:search() Function to query the index directly, 
http://docs.basex.org/wiki/Full-Text_Module#ft:search 
<http://docs.basex.org/wiki/Full-Text_Module#ft:search>

> ft:search(
>   'CTGovDebug',
>   'neoplasms'
> )/.. (: get parent element for the matching text()-node

3) disable chopping when creating the database, 
http://docs.basex.org/wiki/Options#XML_Parsing 
<http://docs.basex.org/wiki/Options#XML_Parsing> 
> db:create(
>   'CTGovDebug',
>   "Path/to/NCT00473512.xml",
>   "NCT00473512.xml",
>   map {
>'ftindex': true(),
>'chop': false()
>   })


3.5) use the xml:space="preserve“ attribute to tell the parser not to chop 
child nodes of  when creating a database:
> 
>   
>   
> ClinicalTrials.gov processed this data on August 31, 
> 2017
> Link to the current ClinicalTrials.gov record.
> 



Hope this helped shed some light :-)

Best from Konstanz
Michael
--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Obere Laube 73, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Tel: +49 7531 916 82 77

> Am 11.09.2017 um 09:35 schrieb Fabrice ETANCHAUD 
> <fetanch...@pch.cerfrance.fr>:
> 
> Hello Ron,
>  
> I don’t know how ft operators behave on document nodes.
> Supposing documents are converted to their data() representation, Your query 
> would yield the same negative answer.
> You should consider applying ft operators on text nodes like this :
>  
> for $trial in db:open('NCT00473512')//text() (: 
> [clinical_study/id_info/nct_id='NCT00473512'] :)
> return $trial[. contains text { 'neoplasms' }]
>  
> Best regards,
> Fabrice Etanchaud
>  
>  
> De : basex-talk-boun...@mailman.uni-konstanz.de 
> [mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part de Ron Katriel
> Envoyé : lundi 11 septembre 2017 00:42
> À : BaseX
> Objet : [basex-talk] Issue with Full Text Retrieval
>  
> Hi,
>  
> I am seeing strange behavior with Full Text retrieval. The following query 
> fails for a number of words that are in the XML document (see attached):
>  
> for $trial in db:open('CTGovDebug') (: 
> [clinical_study/id_info/nct_id='NCT00473512'] :)
> return $trial contains text { 'neoplasms' }
>  
> It fails on a good number of words including neoplasms, cougar, industry, 
> yes, completed, november, 2005, interventional, single, male, female, 
> assignment, none, research, principal, primary, secondary, age, years, 
> gender, etc. But it matches most of the words in the file.
>  
> Observation: The words that fail are located at the beginning and/or end of 
> the text and do not occur anywhere else in the middle of any text.
>  
> The document is the only one in the database. It does not make a difference 
> whether full text indexing is on or off. My BaseX version is 8.6.4.
>  
> Thanks,
> Ron
>  
>  
> Ron Katriel, Ph.D. | Principal Data Scientist | Medidata Solutions 
> <http://www.mdsol.com/>
> 350 Hudson Street, 7th Floor, New York, NY 10014
> rkatr...@mdsol.com <mailto:tbro...@mdsol.com> | direct: +1 201 337 3622 
>  | mobile: +1 201 675 5598 
>  | main: +1 212 918 1800 
> 


Re: [basex-talk] XML import issue (header related)

2017-09-04 Thread Michael Seiferle
Hi Ron, 

Adding another opinion the board (I meant to write this already on Saturday) ;-)
I don’t think there is much to optimize w.r.t. to the XQuery update solution, 
as your whole database will be held in memory during the update…
YET: if you do not care for the namespaces you could still strip them when 
creating your database:

```
db:create(
  'mydb-no-ns',
  '<_>',
  'mydoc2.xml',
  map {"stripns": "yes"}
)```

> http://docs.basex.org/wiki/Database_Module#db:create 
> 
> => • parsing options will only impact string input (URIs, XML strings), 
> because nodes have already been parsed.


Maybe this helps, I am not sure if someone already mentioned it!
Best

Michael

> Am 02.09.2017 um 00:38 schrieb Ron Katriel :
> 
> I can go with the default namespace declaration so no followup is needed, 
> unless you are curious and have the time to investigate.
> 



Re: [basex-talk] New basex-version -> broken paths

2017-09-04 Thread Michael Seiferle
Hi Günter,

sorry for my blatant ignorance, I am using RESTXQ over REST so regularly, that 
I almost forgot about the actual REST-Servlet! 


Still I encourage you to go with fetch:xml(); so if you changed it from:
> let $tokens := fetch:xml("tokens.xml")//entry

To:
> let $tokens := fetch:xml(„relative/to/.basex-home/tokens.xml")//entry

With `fetch:xml` in contrast to `doc()` it should work consistently across all 
modes of operation (REST, RestXQ, BaseX Standalone).
>   See: http://docs.basex.org/wiki/Fetch_Module#Conventions 
>   And this GIST for 
> resolving inconsistencies: 
> https://gist.github.com/micheee/2baf385a1974c9da0db867ed2634cf48


I am not really sure when the behavior of `doc` in the REST servlet changed, 
but a commit between 8.5.4 and 8.6 must have introduced this change.

`RESTPATH` is used to define the location of the XQuery files ran via the 
`?run=`-Parameter, but it does not change the base uri of the static context.


Hope this won’t cause too much trouble with your codebase.

Best
Michael

Btw. You are not the first one to encounter the intricacies of the doc() 
function: https://github.com/BaseXdb/basex/issues/1435 

> Am 04.09.2017 um 14:32 schrieb Günter Dunz-Wolff 
> :
> 
> Hi Michael,
> 
> thanks for the information.
> I changed 
> let $tokens := doc("tokens.xml")//entry
> to
> let $tokens := fetch:xml("tokens.xml")//entry
> (tokens.xml is in the same directory as the xq-file.)
> 
> The problem is still the same:
> [bxerr:BXFE0001] Resource "/Users/User/tokens.xml (No such file or 
> directory)" not found.
> 
> The path should be: /Users/User/Documents/project/BaseXWeb/tokens.xml
> 
> Same problems with RESTPATH empty or path to project-folder.
> 
> As I wrote, I have only problems with the REST-Service, not with RESTXQ.
> 
> Best,
> Guenter



Re: [basex-talk] Simple Map Operator in oXygen XML (XQJ)

2017-09-04 Thread Michael Seiferle
Hi Omar,

Looks like that error message is generated by oXygen; you might want to 
crosspost to their list.

Best
Michael

> Am 04.09.2017 um 14:31 schrieb Omar Siam :
> 
> Hi!
> 
> I just tried to use ther Simple Map Operator while writing an XQuery in 
> oXygen XML and executing the query using a client/server BaseX 8.6.6 data 
> source. I configured it as described here: 
> http://docs.basex.org/wiki/Integrating_oXygen
> 
> When I use the Simple Map Operator (!) I only get "Invalid XQuery syntax, 
> syntax does not pass static validation.". For example using "(1 to 10) ! 
> element node { . }"
> 
> If I run that XQuery in DBA for example it works.
> 
> Any ideas?
> 
> Best regards
> 
> Omar Siam
> 



Re: [basex-talk] New basex-version -> broken paths

2017-09-04 Thread Michael Seiferle
Hi Gunter,
Hi Kendall,

With more recent versions of BaseX I use the db:open() and fetch:xml() 
functions in order to open databases and files.

We introduced those functions because the `doc` function’s omnipotence lead to 
some confusion :-)

The `fetch:xml` function always resolves relative to the current working 
directory, which in the context of RestXQ is the project root, where .basex 
file resides.
`doc()`  otoh  resolves relative to the base-uri of the static context, which 
usually is the currently run query.

I hope this change won’t introduce to much problems with your codebase.

Best from Konstanz

Michael

> Am 04.09.2017 um 07:50 schrieb Kendall Shaw :
> 
> I don’t have an answer, but I was curious and so I tried setting the option 
> RESTPATH to /tmp. I am using 8.6.5.
>  
> With that, run=some.xq and run=../tmp/some.xq both ran the same query. In 
> some.xq I had doc(‘../tmp/some.xml’) and I get an error that
> /opt/tomcat/webapps/basex/tmp/some.xml doesn’t exist. WEBPATH is 
> /opt/tomcat/webapps/basex/.
>  
> So, it could be a difference in settings or default settings between the 2 
> versions, as opposed to being a bug.
>  
> Kendall
>  
> From:  on behalf of Günter 
> Dunz-Wolff 
> Date: Sunday, September 3, 2017 at 4:09 AM
> To: BaseX 
> Subject: [basex-talk] New basex-version -> broken paths
>  
> Hi all, 
>  
> I updated my aged basex-version (8.5.3) to 8.6.6. With the new version, my 
> defined file-references are broken, for example:
> let $style := doc('../xq_diff/remove_elements_from_doc.xsl‘)
> Even files in the same directory with the XQuery-file (corrigenda.xq) like: 
> let $tokens := doc(„tokens.xml")
>  
> With 8.5.3 the REST-Requests with 
> http://localhost:8984/rest?run=xqs/corrigenda.xq 
> 
>  worked without problems.
>  
> With 8.6.6 and with the same request I’ll get the following error:
> Stopped at ., 11/18:
> [FODC0002] Resource '/Users/xq_diff/remove_elements_from_doc.xsl' does not 
> exist
> OR
> Stopped at ., 79/26:
> [FODC0002] Resource '/Users/xxx/kleist_tokens.xml' does not exist.
>  
> It does work in BaseXGUI but not with the http-server. 
>  
> Thanks for any help, Guenter
>  
>  
>  


> Am 04.09.2017 um 07:50 schrieb Kendall Shaw :
> 
> I don’t have an answer, but I was curious and so I tried setting the option 
> RESTPATH to /tmp. I am using 8.6.5.
>  
> With that, run=some.xq and run=../tmp/some.xq both ran the same query. In 
> some.xq I had doc(‘../tmp/some.xml’) and I get an error that
> /opt/tomcat/webapps/basex/tmp/some.xml doesn’t exist. WEBPATH is 
> /opt/tomcat/webapps/basex/.
>  
> So, it could be a difference in settings or default settings between the 2 
> versions, as opposed to being a bug.
>  
> Kendall
>  
> From:  on behalf of Günter 
> Dunz-Wolff 
> Date: Sunday, September 3, 2017 at 4:09 AM
> To: BaseX 
> Subject: [basex-talk] New basex-version -> broken paths
>  
> Hi all, 
>  
> I updated my aged basex-version (8.5.3) to 8.6.6. With the new version, my 
> defined file-references are broken, for example:
> let $style := doc('../xq_diff/remove_elements_from_doc.xsl‘)
> Even files in the same directory with the XQuery-file (corrigenda.xq) like: 
> let $tokens := doc(„tokens.xml")
>  
> With 8.5.3 the REST-Requests with 
> http://localhost:8984/rest?run=xqs/corrigenda.xq 
> 
>  worked without problems.
>  
> With 8.6.6 and with the same request I’ll get the following error:
> Stopped at ., 11/18:
> [FODC0002] Resource '/Users/xq_diff/remove_elements_from_doc.xsl' does not 
> exist
> OR
> Stopped at ., 79/26:
> [FODC0002] Resource '/Users/xxx/kleist_tokens.xml' does not exist.
>  
> It does work in BaseXGUI but not with the http-server. 
>  
> Thanks for any help, Guenter
>  
>  
>  



Re: [basex-talk] Fwd: Re: using apply-function within an updating function

2017-08-29 Thread Michael Seiferle
Hi Rob,
hi Marco,


First: sorry for not coming back to you earlier.

Glad it worked using mixupdates, but I think there might be a way to make it 
work using the new XQUF 3.0 "invoke updating" capabilities  :-)
Christian is currently on holiday, I am sure he will report back on this. 


Best from Konstanz,

Michael

Von meinem iPhone gesendet

> Am 29.08.2017 um 15:17 schrieb Marco Lettere <m.lett...@gmail.com>:
> 
> Hi Rob,
> I suppose that if you add MIXUPDATES=true below #LOCAL OPTIONS in the .basex 
> file that you will find in your basex install directory and restart your GUI, 
> the error will not show up any longer in the GUI itself.
> Regards,
> Marco.
> 
>> On 29/08/2017 15:07, r.stap...@lijbrandt.nl wrote:
>> Hi Michael,
>> 
>> Though the GUI still gives an error onth the use of the apply-function 
>> within an updating function, my webservices do work correctly. Just added 
>> the MIXUPDATES-option in the web.xml file.
>> 
>> Best Rob.
>> 
>>  Oorspronkelijke bericht 
>> Onderwerp: Re: [basex-talk] using apply-function within an updating function
>> Datum: 29.08.2017 08:06
>> Afzender: r.stap...@lijbrandt.nl
>> Ontvanger: Michael Seiferle <m...@basex.org>
>> Kopie: BaseX <basex-talk@mailman.uni-konstanz.de>
>> 
>> Hi Michael,
>> 
>> Th point is that I am looking for a generic solution which I thought I had 
>> found with the use of the apply-function.
>> Most of my webservices take a record with more than one fieldvalue. By 
>> putting the fieldvalues in an json-formatted array on the client side and 
>> the use of the apply-function on the serverside, see [1], I thought I had 
>> found a nice and clean generic solution. Unfortunately this soultion gives 
>> me the error: "Function body must be an updating expression".
>> 
>> The issue is that the error is, in my opinion, falsely triggered by the use 
>> of the apply-function within updating function. An updating-error-situation 
>> should, in my opinion, be determined based on the function that is called by 
>> the apply function. In this case though the apply function calls an updating 
>> function, Basex still triggeres an updating error.
>> 
>> I cann't use MIXEDUPDATES because my webservices are in a module.
>> 
>> I really would like to use the apply-function here. What to do?
>> 
>> [1]
>> declare
>>  %rest:path("/cFactBank/request/new")
>>  %rest:PUT("{$dataRec}")
>>  %input:json("format=map")
>> 
>>  %updating
>>  function _:request.new
>>  ( $dataRec as array(*)
>>  )
>>  {
>>apply( request:new#6
>> , $dataRec
>> )
>>  } ;
>> 
>> 
>> Greetings,
>> Rob
>> 
>> 
>> Michael Seiferle schreef op 28.08.2017 18:20:
>>> Hi Rob,
>>> 
>>> may I ask what you intented to do? Looks like you expect $dataRec to
>>> contain exactly one value, right?
>>> At least I think so because you called `db:create#1` in `fn:apply`
>>> which implies you expect the array to contain a single value.
>>> 
>>> To create a single database use:
>>> 
>>>> ```
>>>> db:create($dataRec => array:get(1))
>>>> ```
>>> 
>>> …or… if you want to create a database for each of the array
>>> values:
>>> 
>>>> for $db in ($dataRec => array:flatten()) (: Flatten array to a
>>>> sequence :)
>>>> return db:create($db).(: create one
>>>> database per array item :)
>>> 
>>> …and… last but not least, for "Dynamic Updating Function
>>> Invocation“[1] you might use:
>>> 
>>>> let $create  := db:create#1
>>>> for $db in ($dataRec => array:flatten())
>>>> return invoke updating $create($db)
>>> 
>>> I could not wrap my head around using array:for-each(#2) and dynamic
>>> updating function invocation; this could make for a more readable
>>> solution, but I can not seem to get the syntax right; if we already
>>> fully support it at all ;-)
>>> 
>>> I hope I did not get you all wrong, feel free to ask for more help!
>>> ;-)
>>> 
>>> Best
>>> Michael
>>> 
>>> [1]
>>> https://www.w3.org/TR/xquery-update-30/#id-dynamic-updating-function-invocation
>>>  
>>> 
>>>> Am 28.08.2017 um 16:42 schrieb r.stap...@lijbrandt.nl:
>>>> 
>>>> Hi,
>>>> 
>>>> I want to use the apply function within an updating webfunction,
>>>> see[1]
>>>> How can this be done?
>>>> 
>>>> TIA,
>>>> 
>>>> Rob Stapper
>>>> 
>>>> [1]
>>>> declare
>>>> %rest:path("/cFactBank/dbCreate")
>>>> %rest:PUT("{$dataRec}")
>>>> %input:json("format=map")
>>>> 
>>>> %updating
>>>> function _:cFactBank.dbCreate
>>>> (  $dataRec as array(*)
>>>> )
>>>> {
>>>> apply( db:create#1
>>>> , $dataRec
>>>> )
>>>> } ;
> 
> 


Re: [basex-talk] using apply-function within an updating function

2017-08-28 Thread Michael Seiferle
Hi Rob,

may I ask what you intented to do? Looks like you expect $dataRec to contain 
exactly one value, right? 
At least I think so because you called `db:create#1` in `fn:apply` which 
implies you expect the array to contain a single value.

To create a single database use:

> ```
>   db:create($dataRec => array:get(1))
> ```

…or… if you want to create a database for each of the array values:

> for $db in ($dataRec => array:flatten()) (: Flatten array to a sequence :)
> return db:create($db).(: create one database per 
> array item :)

…and… last but not least, for "Dynamic Updating Function Invocation“[1] you 
might use:

> let $create  := db:create#1
> for $db in ($dataRec => array:flatten())
> return invoke updating $create($db)

I could not wrap my head around using array:for-each(#2) and dynamic updating 
function invocation; this could make for a more readable solution, but I can 
not seem to get the syntax right; if we already fully support it at all ;-)


I hope I did not get you all wrong, feel free to ask for more help! ;-)

Best
Michael


[1] 
https://www.w3.org/TR/xquery-update-30/#id-dynamic-updating-function-invocation 


> Am 28.08.2017 um 16:42 schrieb r.stap...@lijbrandt.nl:
> 
> Hi,
> 
> I want to use the apply function within an updating webfunction, see[1]
> How can this be done?
> 
> TIA,
> 
> Rob Stapper
> 
> [1]
> declare
>  %rest:path("/cFactBank/dbCreate")
>  %rest:PUT("{$dataRec}")
>  %input:json("format=map")
> 
>  %updating
>  function _:cFactBank.dbCreate
>  (  $dataRec as array(*)
>  )
>  {
>apply( db:create#1
> , $dataRec
> )
>  } ;



Re: [basex-talk] Donation link does not work.

2017-03-17 Thread Michael Seiferle
Hi Tomasz,

thanks for the kudos and thanks even more for your hint, we clearly overlooked 
that one!

The donate link has now been fixed, it will lead you to: 
https://www.paypal.me/BaseXGmbH 

Thanks again!

Michael

> Am 16.03.2017 um 18:51 schrieb Tomasz Kosiński 
> :
> 
> Hello,
> 
> I wanted to show a sign of appreciation to the work you are doing with BaseX, 
> which is in my opinion an exceptionally well done XML database which helped 
> me dozen of times by doing data analysis on large XML data sets.
> 
> But the donation link on your page leads to nowhere.
> 
> -- 
> 
> Best regards
> 
> Tomasz Kosiński
> TestLab Services Tomasz Kosiński
> 
> P: +48 602247984   S: maqmanahan
> 
> 
> NIP: 6721889805
> 
> 
> 
> 
> 
> -- 
> 
> Best regards
> 
> Tomasz Kosiński
> TestLab Services Tomasz Kosiński
> 
> P: +48 602247984  S: maqmanahan
> 
> 
> NIP: 6721889805
> 
> 




Re: [basex-talk] Simple query

2017-03-09 Thread Michael Seiferle
Hi Aaron, 

welcome to the list!

For BaseX to „open“ a collection you need to address it by URI; in your case no 
URI is present, so BaseX loads the „default collection“ which is set to the 
currently opened database (I guess you have none open :—)):


So usually you want to address your collection by name:
> for $foo in collection(‚myFoos‘)
> …
> return $foo

Where each $foo resembles a document inside your collection.
In BaseX a collection usually resembles a database, so your first step would 
be: 

- Create a database that either is a single document or contains multiple 
documents

So in SQL lingo I’d say you are basically missing your FROM ‚…‘ :-)

A good read might be: http://docs.basex.org/wiki/Databases 
<http://docs.basex.org/wiki/Databases> it shows the various ways of creating, 
returning and querying documents / collections :-)



Best
Michael
> Am 09.03.2017 um 00:30 schrieb Aaron Weber <awe...@comcast.net>:
> 
> Newbie alert. 
> 
> I'm trying to get my feet wet with BaseX, and in doing so, am trying to 
> understand XQuery and how to apply it to a database full of documents (not 
> just a single document that is typically queried). 
> 
> I am using Java and can post my code, but with a LocalSession, and a query, 
> the following produces 0 results. 
> 
> For $doc in collection() return $doc
> 
> I realize there's no "where", and in the sql world that would match all. 
> Maybe not in XQuery? 
> 
> Obviously just a test query, but I need to start somewhere. :-)
> 
> Thanks for any help! 
> -- 
> AJ


--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Fon: +49 7531 916 82 77



Re: [basex-talk] Cross-Origin Resource Sharing ( CORS) not available in jetty version 8

2017-02-25 Thread Michael Seiferle
Hi Rob, 

in addition to Christian’s mail, one more thought:

Great, angular2, haven’t had more than a brief look at it so far :-)

I guess you are using that NodeJS-application to serve and generate your 
AngularJS-files, right? Or are there any other reasons you need NodeJS for?

If you only need to serve your static files, you may as well use BaseX to serve 
static contents and put all (e.g. symlink) Angular related stuff to your 
`webapp/static`-folder.

The documentation is here: 
http://docs.basex.org/wiki/Web_Application#Available_Services 

An example can be found  here 
(https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/webapp 
) , 
there is a static folder that will be mapped to localhost:8984/restxq/static


If by any means you need the NodeJS Server next to RestXQ a possible solution 
might be proxying the requests from NodeJS to your BaseX instance; so from the 
Browsers perspective all requests are sent to localhost:3000 :-)
I used https://www.npmjs.com/package/express-http-proxy 
 to redirect all request to 
http://localhost:3000 /restxq ->  
http://localhost:8989/restxq/ 

If you can not modify your NodeJS-service you might have a look at 
https://github.com/gr2m/CORS-Proxy:  it 
provides out-of-the-box CORS headers for arbitrary URLs

Lots of options for these OPTIONS headers ;-)

Hope this helps a bit.

Best from Konstanz

Michael 


P.S. in production it’s usually beneficial to have only a single web-server 
face the world

> Am 25.02.2017 um 09:34 schrieb Rob Stapper :
> 
> Hi Christian,
>  
> I’m trying to build a web based frontend with Angular(2) with Basex as 
> backend. 
> Since Angular uses localhost:3000 and basex uses localhost:8984 I need CORS 
> to be activated in the bachend’s jetty-service.
> If I try to activate this by editing the web.xml file I get the message from 
> the jetty that this service is not available.
> Obviously version 8 of jetty does not support CORS. According to the 
> documentation  Jetty 9 should support CORS.
>  
> Is replacing jett 8 with version 9 somewere on the agenda? Or can I do this 
> myself? (new area for me)
> I wouldn’t mind testrunning it.
>  
> TIA,
> Rob Stapper
>  
> PS. I see the request the request being handled and send back by the backend 
> (basex) but it misses the necessary header. Debugging my Angular app in the 
> browser say that CORS-header is missing.




Re: [basex-talk] Cannot access basex instance with latest basex/dba image

2017-02-08 Thread Michael Seiferle
Hi Björn,
hi Max,

yes, we kind of missed that not-so-subtle-change:
Docker basex/dba is now fixed to the DBA that allows remote connections.
https://hub.docker.com/r/basex/dba/ <https://hub.docker.com/r/basex/dba/>

`docker pull basex/dba:latest`

Should bring back that version.

We are currently figuring out ways to bundle the current dba alongsside 
`basex/basexhttp`.

I’ll keep you posted.

Best from Konstanz,
Michael

> Am 01.02.2017 um 14:52 schrieb Maximilian Gärber <mgaer...@arcor.de>:
> 
> Hi,
> this is how it used to be:
> 
> basex/basexhttp : the standard basex distribution for docker
> basex/dba: only the DBA project
> 
> The idea was to have both running independently where you would
> connect from /dba to /basexhttp
> 
> But this does not work anymore since 8.6
> 
> So for the time being, just use basex/dba prior to 8.6
> 
> 
> 
> 
> 2017-02-01 12:21 GMT+01:00 Christian Grün <christian.gr...@gmail.com>:
>> Hi Björn,
>> 
>>> a) Does this mean that since Version 8.6 there is no officially supported 
>>> web interface for basex?
>> 
>> There still is. DBA is still part of BaseX, but it doesn’t provide
>> means to connect remotely.
>> 
>>> b) What is the difference between the basex/basexhttp and basex/dba images? 
>>> (I think the documentation at https://hub.docker.com/r/basex/basexhttp/ is 
>>> now misleading)
>> 
>> Personally, I can’t say anything about Docker. Maybe someone else on
>> the list knows more?
>> 
>> Christian


--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Fon: +49 7531 916 82 77



[basex-talk] Docker run basexhttp and permission issues

2016-08-25 Thread Michael Seiferle
Hi BaseX-Talk, 

in case any of you is using our docker images, in recent builds there seems to 
be a bug related to the ENTRYPOINT and the PARENT mvn Image we are using.

If you encounter the following error message (in fact you should if you docker 
pulled recently ;-)):

> ⇒  docker run basex/basexhttp
> touch: cannot touch ‘/root/.m2/copy_reference_file.log’: Permission denied
> Can not write to /root/.m2/copy_reference_file.log. Wrong volume permissions?

You might want to override the ENTRYPOINT yourself:

> docker run --entrypoint=basexhttp basex/basexhttp


I already proposed a fix but I’d like someone with docker-expertise have a 
look, maybe s/o might want to add her or his 5cts ;-)
https://github.com/BaseXdb/basex/pull/1346 
<https://github.com/BaseXdb/basex/pull/1346>

Best
Michael

--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Fon: +49 7531 916 82 77



Re: [basex-talk] RESTXQ and xsd validation strangeness

2016-05-18 Thread Michael Seiferle
Hi Marco,

this one is not too obvious, yet:

the type of $body is „document-node()“ not element, so what I think happens is 
the following:

> validate:xsd-info($body…
receives a document-node() and somehow* BaseX passes a documents string 
representation to validate:xsd-info(), which happens the be the documents 
base-uri(), hence: "`tmp/basex/POST.xml` could not be found".


I am not 100% sure my explanation is correct, yet you could solve your problem 
by passing the element child of that document-node to the validate function, as 
follows: 

declare
  %rest:path("/testxsd")
  %rest:POST("{$body}")
  %rest:consumes("application/xml")
function page:testxsd($body as document-node()){
validate:xsd-report(
$body/element(),
http://www.w3.org/2001/XMLSchema;>)
};

See this gist for my experiments:

https://gist.github.com/micheee/025ffed4fbb06bc4b4200ab959755e3b


Hope this helps
Michael

* -> somehow means: most probably specified by rules I do not know of ;-)

> Am 13.05.2016 um 09:57 schrieb Marco Lettere <m.lett...@gmail.com>:
> 
> Dear all,
> this question triggers a dejavu in my head and I'm pretty sure this has been 
> discussed some time ago so I'm not sure why it strikes back at us ...
> With the latest snapshot (but with 8.4.4 it's the same) downloaded just few 
> minutes ago I start the basehttp server.
> Then I add the foolowing RestXQ to the restxq.xqm file:
> 
> declare
>  %rest:path("/testxsd")
>  %rest:POST("{$body}")
>  %rest:consumes("application/xml")
> function page:testxsd($body){
>  validate:xsd-info($body, "xsd.xsd")
> };
> 
> I store the following dummy xsd as xsd.xsd in the webapp folder:
> 
> 
> http://www.w3.org/2001/XMLSchema;>
> 
> 
> 
> 
> 
> 
> I invoke the restxq with:
> 
> curl -vd ""  http://localhost:5000/testxsd -H 
> "Content-type:application/xml"
> 
> Getting back the following error:
> 
> Error 400 Stopped at /tmp/basex/webapp/restxq.xqm, 12/20:
> [bxerr:BXVA0002] Validation could not be started: Resource 
> "/tmp/basex/POST.xml (No such file or directory)" not found.
> 
> This happens no matter what xml and what xsd is used. If I change $body with 
>  in the call to validate:xsd-info everything works smoothly ...
> Any ideas?
> Thanks,
> Marco.


--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Fon: +49 7531 916 82 77



Re: [basex-talk] Basex on maven central

2016-05-13 Thread Michael Seiferle
Hello we are currently working on updating maven central as well.

Jagrut investigates the options to do this :-)

Cheers from Lake Constance

Michael
Von meinem iPhone gesendet

> Am 13.05.2016 um 09:00 schrieb Marc van Grootel :
> 
> Hi Lance,
> 
> Just add http://files.basex.org/maven and optionally
> http://xqj.net/maven as additional repositories.
> I don't find this very inconvenient. This repo gets all the latest
> releases and snapshots right out of the oven.
> 
> Not sure why it's not uploaded to Central anymore though.
> 
> Cheers,
> --Marc
> 
> 
>> On Thu, May 12, 2016 at 5:45 PM, Lance Java  
>> wrote:
>> It seems that maven central is not up to date with the latest basex version.
>> I see here that there's only version 7.3.1 whereas on the basex website the
>> latest version is 8.4.4
>> 
>> http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.basex%22
>> 
>> Are there any plans to keep maven central up to date with basex releases?
> 
> 
> 
> -- 
> --Marc


Re: [basex-talk] Load 5GB xml using python

2016-05-09 Thread Michael Seiferle
Hello Henning,

a kind of naive approach might be uploading the file to your server via a 
webservice implementation of your choice (e.g. python).

You could then create a database from that temporary file on the server. This 
way you could avoid „caching“ the file in memory.

You might also consider switching to a RestXQ based approach.
Another option, regardless how you choose to upload the file, that could speed 
up the process would be Zippig the XML before sending it to the server.

Hope this helps! Feel free to ask for more!

Best Michael

> Am 09.05.2016 um 00:01 schrieb Henning Phan <henningp...@hotmail.com>:
> 
> Hello,
> My case:
> 1. A (non technical) user uploads a 5 GB xml which gets parsed by basex
> 2. Does some queries to check and modify some values
> 3. Downloads the modified 5 GB xml back.
> 
> So I'm planning to allow the user to edit their xml through a web application 
> and therefore the user must upload the xml to the web application. I'm using 
> python and when I receive the xml I want to create a database by using the 
> create function from the client API, but the create(name, content) forces me 
> to load the 5GB in memory which it cannot handle.
> 
> I read the java client API which takes a stream unlike the python API. Am I 
> forced to use java?
> 
> What options are there to solve this problem gracefully? Any options that 
> involve Python?
> 
> Thank you for reading this
> 
> - Henning


--
Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Fon: +49 7531 916 82 77



Re: [basex-talk] nilled() not working

2015-01-15 Thread Michael Seiferle

Dear Ankit,

BaseX is not a schema aware XQuery processor, hence your results.


In BaseX fn:nilled() will always return false.

Element nodes in BaseX will always be untyped, see for instance:
http://www.w3.org/TR/xpath-datamodel-30/#ElementNode = Property 11 and
http://www.w3.org/TR/xpath-functions-30/#func-nilled = in the notes.
So with respect to the specification fn:nilled() is working correctly, 
however it fails to live up to the expectations :-)


You can, nevertheless, mimic the fn:nilled() behavior, using this custom 
function I hacked together for you:

https://gist.github.com/micheee/b16586464b895f08ddfb

Depending on what you need, this might work just well.

Hope this helps.

Best from Constance,

Michael

P.S.The example code in my function has been shamelessly adapted from: 
http://www.xqueryfunctions.com/xq/fn_nilled.html :-)



On 15 Jan 2015, at 11:11, ankit kumar wrote:

I am trying to run fn:nilled() function in base-x, but every time a 
node
with xsi:nil=true is passed to the function it return false. Please 
help

me out.


Re: [basex-talk] Editor Background Color

2014-12-18 Thread Michael Seiferle
Hi Alex,

currently there is no way (at least no way that I am aware of :-)) to customize 
the background color of the various editor panels from *inside* BaseX, maybe 
your OS or window manager might do that.

I think it might need quite some time to provide a dark-theme, as one would 
need to update the syntax highlighting code as well.

However, I might be interested in this feature as well :-)


Best
Michael

On 18 Dec 2014, at 2:16, Christian Grün wrote:

 Hi Alex,

 I know that one of our team members is using BaseX with a dark desktop
 theme (on Mac OSX), so he might give you some hints.

 Could you possibly give us some more information on your environment?
 What OS do you use?

 Thanks,
 Christian


 On Thu, Dec 18, 2014 at 12:22 AM, Alex R. Loayza log...@yahoo.com wrote:
 Hello,

 I’m new to BaseX, and I’m trying to customize the GUI, by changing the
 background color of the Editor  panel. I always use dark themes in IDEs
 because bright whites hurt my eyes.

 However, I’ve found no way to change that setting in Base X. The Options /
 Colors setting in the main menu effects changes to panels other than the
 Editor.

 Is there a way to customize this?

 Thank you very much for any help, and especially for having built this great
 product and making it open source!

 Best regards,

 Alex



smime.p7s
Description: S/MIME digital signature


Re: [basex-talk] Paged results

2014-08-18 Thread Michael Seiferle

Hi Paul,

thanks for this snippet!
Have you already seen the built-in min/max functions?

max((1,2,3)), min((1,2,3))
Might save both, some bytes and milliseconds, neglectable but 
nevertheless. :-)



Best from Konstanz

Michael
On 15 Aug 2014, at 22:02, Paul Swennenhuis wrote:


Hi all,

Triggered by a thread in this forum I decided to make a paged() 
function that adds paging information to a node-set.
It does so by wrapping the node-set in an root element - with a name 
of your choice - with attributes for total number of nodes, 
start-index  requested page-size, actual page-size and end-index.
The last function argument lets you select whether or not to output a 
paged node-set or just wrap the node-set in a root element.


It's not very spectacular but it may be of use if you want to use 
BaseX for paged results or endless scrolling.

Comments are appreciated.

The module with the paged() function:
-
module namespace lib = My Library;

(:
lib:paged adds paging information to a node-set
in order to enable paged results for a web-app
Will return a node with the name as specified in $nodeName
along with total number of nodes ($total), start-index ($start), 
requested page-size ($num), actual page-size ($displayed)
and end-index ($end) as attributes, followed by the subsequence of the 
node-set


Collection MUST be a node-set (i.e. must NOT have a root element)

If $doPaged argument is false(), only the root node with the original 
collection is returned
The parameter makes it easier to do a non-conditional call of the 
function on a node-set


:)

declare function lib:paged ($collection, $nodeName, $start, $pageSize, 
$doPaged) {

let $total := count($collection)
let $min := lib:max(lib:min($pageSize,lib:min($total,$total - $start + 
1)),0)

return
 element {$nodeName} {
   if ($doPaged) then (
attribute total {$total},
attribute start {$start},
attribute pageSize {$pageSize},
attribute actualPageSize {$min},
attribute end {$start + $min - 1},
subsequence($collection, $start, $pageSize)
 )
   else
$collection
 }

};

(: Return smallest of two numbers :)

declare function lib:min($a,$b) {
if ($a  $b) then $a else $b
};

(: Return largest of two numbers :)

declare function lib:max($a,$b) {
if ($a  $b) then $a else $b
};




Usage example:

---

import module namespace lib=My Library at library.xqy;

lib:paged(collection(Facts)//city, 'cities', 500, 300, true())



Paul


Re: [basex-talk] 7.8.2 application on Mac OS X

2014-04-24 Thread Michael Seiferle
Hi James,

my bad!
I forgot to fix the 7.8.2 bundle; the „latest“ bundle should already work for 
you: 
 http://files.basex.org/releases/BaseX-latest.app.zip

I’ll try to update the 7.8.2 bundle this evening! I’ll let you know once this 
happened.

Best
Michael
Am 23.04.2014 um 15:33 schrieb James Ball basex-t...@jamesball.co.uk:

 Hello,
 
 Is anyone else having problems with the BaseX 7.8.2.app.zip file on Mac OS X 
 (downloaded from the BaseX site)?
 
 When I unzip the file I get a no entry sign over the application icon and 
 launching the application gets an ‘You can’t open the application 
 BaseX782.app” because it may be damaged or incomplete.’
 
 I think the name of the application should be BaseX.app rather than 
 BaseX782.app so I think the packaging has gone wrong somewhere.
 
 Inside the package is a file called EMPTY and a BaseX.app - but this doesn’t 
 launch for me either.
 
 Many thanks, James
 
 -
 James Ball
 




smime.p7s
Description: S/MIME cryptographic signature


Re: [basex-talk] whitespace around comments

2013-04-05 Thread Michael Seiferle
Michael (other than me :-)) you are obviously right.


—
Mit freundlichen Grüßen
Michael Seiferle

On Fri, Apr 5, 2013 at 12:29 PM, Michael Piotrowski m...@cl.uzh.ch wrote:

 Dirk,
 On 2013-04-05, Dirk Kirsten d...@basex.org wrote:
 You are certainly right that with mixed content and the example you have
 given here chopping does make a semantic difference.
 However, you can disable this behaviour so BaseX does what you want. So the
 only reason I see why one should change the default behaviour would be
 because the default is not confirmant to some XML standard. However, I can
 not find any specifics in the spec about which is the expected behaviour,
 so in my opinion BaseX is doing nothing wrong here.
 Well, if you agree that chopping may alter the semantics of a document,
 wouldn't you agree that applying such a transformation *by default* is a
 bad idea?
 With respect to the XML specification, section 2.10 White Space
 Handling says:
   An XML processor MUST always pass all characters in a document that
   are not markup through to the application.
 Yes, the spec is vague wrt. to whitespace handling, and the existence of
 the xml:space attribute shows that different behaviors--including
 potentially corrupting ones--are possible.  I would therefore interpret
 the spec to mean that by default all characters should be preserved, but
 that other behaviors are possible.
 I see that this behaviour might be surprising for some users, but this
 might as well be the case if it were the other way round.
 No, because their documents wouldn't be corrupted.  You can easily
 remove all whitespace afterwards if you decide you don't need it, but
 once it's gone, it's gone and cannot be restored.  That's the problem.
 Additionally, if we would change this now it would break application
 code and unless there is a good reason (i.e. BaseX is actually doing
 something wrong or non-compliant) I don't see why one should change
 the default.
 Well, I'm not on a crusade or anything, so if you believe that it's a
 good idea to corrupt, by default, all documents containing mixed content
 on import, or if this behavior must be kept for compatiblity, so be it.
 I just wanted to point out that whitespace chopping may, in fact, alter
 the semantics of documents--it's not as harmless as it may seem.
 Best regards
 -- 
 Dr.-Ing. Michael Piotrowski, M.A. m...@cl.uzh.ch
 Institute of Computational Linguistics, University of Zurich
 Phone +41 44 63-54313 | OpenPGP public key ID 0x1614A044
 * OUT NOW: Natural Language Processing for Historical Texts
 * http://morganclaypool.com/doi/abs/10.2200/S00436ED1V01Y201207HLT017
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Pathname of the current XQuery?

2013-04-04 Thread Michael Seiferle
Thanks Liam, 
you are right, the shortest way to achieve should be the following:

 let $path-to-query-file := base-uri(_/)


Best from Konstanz

Michael

Am 02.04.2013 um 05:36 schrieb Liam R E Quin l...@w3.org:

 On Mon, 2013-04-01 at 13:36 -0400, Graydon Saunders wrote:
 
 I'd like to be able to say something like
 
 let $decisionSchema :=
 concat(string-join(tokenize(get-query-path(),'/')[position() ne
 last()],'/'),'/decisions_schema.xsd')
 
 only I can't figure out what get-query-path() is.
 
 For many Query engines it won't be defined.
 
 You could try constructing an element and asking for its base URI I
 suppose.
 
 Liam
 
 -- 
 Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
 Pictures from old books: http://fromoldbooks.org/
 Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
 
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Unable to integrate with oxygen to run xquery

2012-11-22 Thread Michael Seiferle
Hi Alex, 

I can only help you with two quick guesses at the moment: 

1)
  port  8080
looks like a kind of HTTP Port; the server by default runs on port: 1984 does 
this change anything?


2) does changing your query to: 
  let $content := //MessageHeader
  return $content[1]

change anything?

I just tried to set up the oxygen integration as depicted in our wiki and it 
worked on Mac OS,  using the 7.3 ZIP and the XQJ Drivers found @xqj.net
I know this it works on my machine probably does not help you much, but I am 
confident we can find the cause of your problem :-)

Best
Michael

Am 22.11.2012 um 00:47 schrieb Alex Muir alex.g.m...@gmail.com:

 Same response...
 
 On Wed, Nov 21, 2012 at 6:26 PM, Christian Grün christian.gr...@gmail.com 
 wrote:
  let $content := //MessageHeader
  return $content
 
 You could try to directly address the database in your query:
 
 let $content := db:open('DDEX')//MessageHeader
 return $content
 
 Does this help?
 Christian
 ___
 
  I've got basex set up using jetty and can query within the firefox browser
  to return data for example using the url
 
  http://localhost:8080/rest/DDEX?query=//MessageHeader
 
  however my equivalent oxygen xquery does not return data and rather
  continues to run not stopping
 
 
  I've recently downloaded the jars and configured the Data Source Drivers as
  per the http://docs.basex.org/wiki/Integrating_oXygen
 
  file:/mnt/xslt_volume/i4EnrichV7/analysis/resources/libs/basex-xqj-1.2.3.jar
  file:/mnt/xslt_volume/i4EnrichV7/analysis/resources/libs/xqj-api-1.0.jar
  file:/mnt/xslt_volume/i4EnrichV7/analysis/resources/libs/xqj2-0.1.0.jar
 
  In the basex  connection which is enabled I've got the following settings
 
  port  8080
  databaseNameDDEX
  logLevel
  description
  loginTimeout6000
  serverName localhost
  user admin
  password admin
 
  I
   set up a trasformation scenario with  BaseX transformer with the following
  xquery
 
 
 
 
 -- 
 -
 
 Alex G. Muir
 Software Engineering Consultant
 Linkedin Profile : http://ca.linkedin.com/pub/alex-muir/36/ab7/125
 Love African Kora Music? Take a moment to listen to Gambia's - Amadu Diabarte 
  Jali Bakary Konteh www.bafila.bandcamp.com Your support keeps Africa's 
 griot tradition alive... Cheers!
 
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] id function in BaseX

2012-10-31 Thread Michael Seiferle
Hi Massimo,
Hi Ben, 

BaseX has no direct support for extracting the information, that for a given 
document the ID is renamed to @key (even with help of a DTD).
This is why those example queries fail to function as expected. BaseX will 
however work if the ID attribute is named @id. 

Long story short: you can mimic this behaviour, which you might have already 
known by running:
 declare function local:id($id as xs:string,
   $nodes as node()){
   $nodes//*[@key = $id]
 };
 local:id(M4M05, .)

or if you do not want to wrap it in a function, 
 //*[@key = M4M05]


Hope this helps
Michael


Am 29.10.2012 um 19:22 schrieb Ben Companjen bencompan...@gmail.com:

 This is just a guess, but did you include the DTD? As the document
 says: Notice that the id() functions works only if you have properly
 declared the ID and IDREF attributes in the document DTD.
 
 Ben
 
 On 29 October 2012 13:49, Massimo Franceschet
 massimo.francesc...@uniud.it wrote:
 Hi.
 
 I'm trying to use the XPath id function with BaseX (GUI interface) with no 
 success. For instance, I'm querying the bibliographic XML document found at 
 http://users.dimi.uniud.it/~massimo.franceschet/caffe-xml/xpath/xpath-syntax3.html
  with the id queries written below in this page, for instance, id(M4M05). 
 The query is parsed correctly by BaseX but the result is always empty.
 
 Cheers,
 
 Massimo Franceschet
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] id function in BaseX

2012-10-31 Thread Michael Seiferle
Hi Massimo, 

sorry, I'm a little in a hurry:
The spec states: 
 http://www.w3.org/TR/xpath-datamodel/#dm-is-id
 Exactly what constitutes an ID depends in part on how the data model was 
 constructed, see 6.2 Element Nodes and 6.3 Attribute Nodes.
which says: 
 is-id
 If the attribute is named xml:id and its [attribute type] property does not 
 have the value ID, then [xml:id] processing is performed. This will assure 
 that the value does have the type ID and that it is properly normalized. If 
 an error is encountered during xml:id processing, an implementation may raise 
 a dynamic error. The is-id property is always true for attributes named 
 xml:id.

as BaseX does not check/care for the types when parsing, we follow: 
 The is-id property is always true for attributes named xml:id.

I hope I read the spec right; others will correct me :-)

Best
Michael
Am 31.10.2012 um 14:44 schrieb Massimo Franceschet 
massimo.francesc...@uniud.it:

 
 Il giorno 31/ott/2012, alle ore 14:39, Michael Seiferle ha scritto:
 
 Hi Massimo,
 Hi Ben, 
 
 BaseX has no direct support for extracting the information, that for a given 
 document the ID is renamed to @key (even with help of a DTD).
 This is why those example queries fail to function as expected. BaseX will 
 however work if the ID attribute is named @id. 
 
 Thanks Michael, this explains the failure. Strange behavior, anyway. I know 
 that ID-type attributes can have any name, not necessarily the name id. Is 
 BaseX behavior coherent with W3C specifications?
 
 Best,
 
 Massimo

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] running xquery scripts in REST server

2012-10-19 Thread Michael Seiferle
Hi Peter, 
sorry I did not manage to answer you earlier :-)
 
As a quick hint, could you please try the following:
* put your query file into the filesystem as described in 
http://docs.basex.org/wiki/REST 
* Please note, that in 7.3 the variable WEBPATH has been called HTTPPATH (I 
hope this does not add to the confusion ;-))

Apart from that, I can only encourage you to have a look at RestXQ as it is 
most flexible in my opinion for running XQuery server-side and empowering not 
only rest service but interactive website as well. 
= http://docs.basex.org/wiki/RESTXQ

Hope this helps!

Kind Regards
Michael
Am 17.10.2012 um 10:50 schrieb p...@themail.co.uk:

 
 Hello List
 
 this is a noob question:
 
 I have BaseX 7.3 set up using httpserver.  I can add a script to
 HTTPPATH and run it using http://{server:port}/rest?run=myScript.xq
 
 However, if I add myScript.xq to a database and try to run it then
 [http://{server:port}/rest/DB/myScript.xq ] then all I get returned
 is the XQuery script itself as a text file, the query doesn't run.
 
 From the examples e.g. http://docs.basex.org/wiki/REST#GET_Requests_2
 I thought that I am doing the same type of call, e,g,
 http://localhost:8984/rest/DB/mult.xq?a=21b=2 
 
 What should I be doing?
 
 Many thanks
 
 Peter
 
 
 
 
 
 
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Bug in db:rename()

2012-10-17 Thread Michael Seiferle
Dear Charles, 

Thank you very much for your report; and sorry for this inconvenience. 
Someone of our team will have a look and we will get back to you ASAP.

Best
Michael

Von meinem iPad gesendet

Am 16.10.2012 um 22:23 schrieb Charles Kowalski alxa...@gmail.com:

 On 10/16/2012 11:20 PM, Charles Kowalski wrote:
 Hi,
 
 Upon executing:
 
 db:rename('dbname', '', 'path')
 
 All database data was put under a root collection named 'ath' not the
 expected 'path'.
 
 The first letter gets chopped, something to do probably with string
 manipulation and zero string length.
 
 Thanks,
 alex
 To correct my previous description the first letter of every *child* path 
 gets lost
 
 db:replace('db', 'test.xml', root/)
 db:rename('db', '', 'renamed')
 
 results in:
 'renamed/est.xml'
 
 Thanks,
 alex
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Using full Java regular expressions

2012-10-15 Thread Michael Seiferle
Hi Gary, 

not directly a flag, but you are for sure able to use Java classes from within 
BaseX like so https://gist.github.com/c72fad2758af668eb0f1

More information on our Java Bindings can be found here: 
http://docs.basex.org/wiki/Java_Bindings

I hope this helps, feel free to ask for more help =)

Michael
Am 13.10.2012 um 16:10 schrieb The Trainspotter wy...@btinternet.com:

 Hi,
 
 I'm currently converting my project to use BaseX instead of Saxon. One thing 
 you can do in Saxon is provide a flag (an exclamation mark) to your regular 
 expression to tell the matches function to use the Java regular expression 
 processor, rather than the rather cut down expressions available in the 
 XQuery spec.
 
 Is there anything similar in BaseX? 
 
 If not what do you recommend to define a Java regular expression based 
 function for XQuery?
 
 Thanks in advance,
 Gary
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Using full Java regular expressions

2012-10-15 Thread Michael Seiferle

Am 15.10.2012 um 15:35 schrieb The Trainspotter wy...@btinternet.com:

 Is this switch something I could request as an enhancement,
Yes
 if so could I expect it to be implemented any time soon?
 
...not necessarily as I can not promise that someone will jump on this train 
anytime soon.
BUT it is for sure the first step towards completion :-))

Hope this helps
Michael


___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Navigating a DOM

2012-10-15 Thread Michael Seiferle
Hi there, 

just for the sake of completeness, my 2cents:
Am 15.10.2012 um 16:53 schrieb Rainer Klute rainer.kl...@itemis.de:

 As far as I am aware, Sedna is
 actually ideal for storing huge single file XML documents.
I am not sure if Sedna is better suited or not, but this is out of topic anyway 
:-).
 Would be a nice try if Sedna could run on Android. But it is in C and
 not Java, so …
I don't think the actual problem is storage or processing, but your application 
demanding for DOM like navigation and lazy loading of Elements.
This is indeed out of BaseX’ scope (at least at the moment) as far as I can 
see. 

I do not know your specifics, but I'd suggest you should at least consider 
giving BaseX (or any XML database for that matter) a try.

It’s rather easy and quick to extract only portions of a document and load 
other parts on demand. Usually even with documents of several gigabytes in 
size, thanks to indices, performance mainly depends on how much data you want 
and need at a given time.

But anyway, my reply is just for the sake of completeness, feel free to pursue 
whichever approach feels best for you and solves your problem :-)

Kind regards
Michael

P.S. (bold claims following ;-))
I doubt that a non disk persisted tree representation— such as XOM or SAX— is 
able to beat an XML database when it comes to tasks other than serializing the 
whole document, and even there most databases might be well on par as 
serializing the on disk representation should be straight forward.
XOM in their documentation states that you should not consider using XPath, as 
performance may degenerate. 
So deciding for or against XOM depends heavily on what you actually want and 
need :-)___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Navigating a DOM

2012-10-15 Thread Michael Seiferle
Hi Rainer,
 I am in fact not sure if such an API  exists; at least to my knowledge it does 
not.

Thanks for the valuable input and fruitful discussion so far :-)

Feel free to keep in touch and this thread alive. 
Feedback and questions are always very welcome!

Best 
Michael
Am 15.10.2012 um 19:12 schrieb Rainer Klute rainer.kl...@itemis.de:

 Well, since I won't get this
 lazy-loading-while-navigating-a-DOM-thingy anywhere, I'll have to
 reconsider my system architecture and find another solution.
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] XSLT import with relative path fails

2012-10-04 Thread Michael Seiferle
Hi Alexandros,

thanks for your mail, I will have a look at this. IIRC there is no URI 
resolution on BaseX’ behalf, but maybe the current working directory for Saxon 
is not set to what Saxon expects. 
Out of curiosity, does it work if you use absolute paths in the first place? I 
guess you are calling sth. like xslt:transform($doc, path/to/tei/...)

I'll try to have a look at it this afternoon, I guess this issue might as well 
affect other users. 
If you could provide me with a SSCE that can be run easily that would be great 
but not a necessity.

Cheers
Michael

Am 02.10.2012 um 16:50 schrieb Charles Kowalski alxa...@gmail.com:

 Hi,
 
 I am trying to use TEI-to-xhtml stylesheet* provided by the tei consortium 
 using the saxon HE transformer.
 The importing of xsl dependencies fails with this error:
 XTSE0165: I/O error reported by XML parser processing file:/../xhtml2/tei.xsl:
   /../xhtml2/tei.xsl (No such file or directory)
 The specific file i try to run is 
 The actual href in the xsl:import is xsl:import 
 href=../../../xhtml2/tei.xsl/
 
 From the error message it looks as if the relative path: 
 ../../../xhtml2/tei.xsl
 is converted to the (non-existent) absolute path: /../xhtml2/tei.xsl 
 
 The same transformation works fine if called from the cli with
 java -jar path/to/saxon9he.jar some-tei.xml 
 path/to/tei-stylesheets/xml/tei/stylesheet/profiles/tei/html/to.xsl
 Is there some sort of url resolution happening on behalf of basex before the 
 xsl is passed to saxon?
 
 I will try to reproduce with a set of less complex xsl files but it seems 
 like the issue lies with relative path resolution.
 
 Thanks, 
 Alexandros
 
 *You can download the latest stylesheets from sourceforge at: 
 http://sourceforge.net/projects/tei/files/Stylesheets/tei-xsl-6.14.zip/download
 ___
 BaseX-Talk mailing list
 BaseX-Talk@mailman.uni-konstanz.de
 https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] large number of xml files

2012-08-21 Thread Michael Seiferle
Hi Sateesh, 

is saw that you sent dirk an XQuery file, is it the same that takes that much 
memory?
In case yes we will see if we can help with that :)
Kind Regards
Michael
Am 20.08.2012 um 14:34 schrieb sateesh sate...@intense.in:

 Hi Michael,
 
 I created the collection of 2k xml's as per your previous mail and tried
 executing the query,even though after creating the collection also the
 memory consumption is high(700MB of heap memory) and also it is taking 3
 mins of time for processing.
 
 Thanks  Regards
 Sateesh.A
 
 -Original Message-
 From: Michael Seiferle [mailto:m...@basex.org] 
 Sent: Monday, August 20, 2012 2:33 PM
 To: sateesh
 Cc: basex-talk@mailman.uni-konstanz.de
 Subject: Re: [basex-talk] large number of xml files
 
 Sateesh, 
 
 sorry I totally overlooked your last email.
 I'll reply inline:
 Am 18.08.2012 um 08:58 schrieb sateesh sate...@intense.in:
 
 
 Hi Micheal,
 
 I have tried to implemet your suggested changes , but I got struck as the
 10k xml's which I have to query on comes from different folders,and also
 one
 more question is how do I create collections using the program before
 running the query.
 XQuery at the moment has no possibility to create a collection on the fly,
 as such you would have to use our Java API  [1] or Commandline API [2].
 
 For creating a collection from different folders you would do as follows:
 create db myDB path/to/files;
  . creates the database coll with all documents found in the input
 directory.
 
 ADD TO target/ xmldir
  . adds all files from the xmldir directory to the database in the
 target path.
 
 
 I hope this helps :-)
 
 Kind Regards
 Michael
 
 
 Thanks  Regards
 Sateesh.A
 
 
 [1]
 https://github.com/BaseXdb/basex-examples/blob/master/src/main/java/org/base
 x/examples/query/CreateCollection.java
 [2] http://docs.basex.org/wiki/Commands
 
 
 

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


  1   2   >