Re: [basex-talk] file:move() fails when moving to another file system

2020-02-12 Thread Christian Grün
> Looks to me like query/func/file/FileCopy.java uses Files.move() when
> it thinks i can, but this will fail on Unix-like systems if you try to
> move a file across file system boundaries (because then the kernel
> would need to copy the data).

True, I thought similarly. It turns out these cases seems to be
already considered by the Java implementation (if preferred, however,
all this magic can be disabled via an ATOMIC_MOVE flag [1]).

In found some entries reg. problems with Files.move in the JDK bug
reports, but nothing that matches our observations in detail. So I
think we’ll need to live with copy & delete for the moment until we
can reproduce this more easily.

[1] 
https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#move-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-


Re: [basex-talk] Full text and stopwords

2020-02-12 Thread Ben Engbers
Op 12-02-2020 om 10:21 schreef Ben Engbers:
> Hi Christian,
> 
Would it be a good approach to create a separate database for stop words
and sentiments?

> 
> Cheers,
> Ben
> 



[basex-talk] XDM metadata

2020-02-12 Thread Ben Engbers
Hi Christian,

According to the server protocol, when first sending \04 to the server,
the resulting items from the query are returned as strings, prefixed by
a single byte.
With my RBaseX-package, the result from
"for $i in 1 to 2 return Text { $i }"
is
"0b" "Text 1" "0b" "Text 2"

When sending \1F the strings should be prefixed by the XDM metadata.

In my case however, the output is the samen as with \04.

Is it possible to get the same output for querys in the basexgui so that
I can see which output should be expected?

This is the last remaining problem in my package. If I can resolve it, I
can upload a new version.

Cheers,
Ben



[basex-talk] Full text and stopwords

2020-02-12 Thread Ben Engbers
Hi Christian,

According to the docs, a stopword list can be used to decrease the size
of the full text index. I had no problems when using this list while
creating a database.

Is it also possible to use this list for other purposes?

1
According to XQueryX 3.1.pdf it is possible to use a sequence of
stopwords in a query:
/books/book[@number="1"]//p contains text "propagating of errors"
using stop words ("a", "the", "of").

How can I use this list in BaseX while building querys?

2
Is it possible to add words to the list, after that is has been loaded?
Suppose that it shows that my text contains a lot of names that I want
to exclude. How can I add those names to the stopwords list?

3
If I want to create a Wordcloud, I want to use all the words that remain
after tokenization and removing all the words from the stopwords list.

(I found this item 'https://en.wikibooks.org/wiki/XQuery/Tag_Cloud'. It
might be a good starting point for creating a wordcloud)

Cheers,
Ben



Re: [basex-talk] file:move() fails when moving to another file system

2020-02-12 Thread Liam R. E. Quin
On Wed, 2020-02-12 at 08:44 +, Zimmel, Daniel wrote:
> > A last try: What do you get if you run it with basex (the
> > standalone, not the client)?

Looks to me like query/func/file/FileCopy.java uses Files.move() when
it thinks i can, but this will fail on Unix-like systems if you try to
move a file across file system boundaries (because then the kernel
would need to copy the data).

One approach might be to catch failure of Files.move() and try again
with Files.copy().

Liam

-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org



Re: [basex-talk] file:move() fails when moving to another file system

2020-02-12 Thread Zimmel, Daniel
> A last try: What do you get if you run it with basex (the standalone, not the 
> client)?

java.nio.file.FileSystemException: [...]: Die Operation ist nicht erlaubt
at 
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:288)
at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:476)
at 
java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:263)
at java.base/java.nio.file.Files.move(Files.java:1413)
at org.basex.query.func.file.FileCopy.relocate(FileCopy.java:75)
at org.basex.query.func.file.FileCopy.relocate(FileCopy.java:53)
at org.basex.query.func.file.FileMove.item(FileMove.java:18)
at org.basex.query.func.file.FileFn.item(FileFn.java:25)
at org.basex.query.func.file.FileCopy.item(FileCopy.java:18)
at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50)
at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45)
at org.basex.query.scope.MainModule.iter(MainModule.java:97)
at org.basex.query.QueryContext.iter(QueryContext.java:332)
at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90)
at org.basex.core.cmd.AQuery.query(AQuery.java:107)
at org.basex.core.cmd.XQuery.run(XQuery.java:22)
at org.basex.core.Command.run(Command.java:257)
at org.basex.core.Command.execute(Command.java:93)
at org.basex.api.client.LocalSession.execute(LocalSession.java:132)
at org.basex.api.client.Session.execute(Session.java:36)
at org.basex.core.CLI.execute(CLI.java:92)
at org.basex.BaseX.(BaseX.java:100)
at org.basex.BaseX.main(BaseX.java:42)
org.basex.query.QueryException: [...]: Die Operation ist nicht erlaubt
at org.basex.query.QueryError.get(QueryError.java:1431)
at org.basex.query.func.file.FileFn.item(FileFn.java:35)
at org.basex.query.func.file.FileCopy.item(FileCopy.java:18)
at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50)
at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45)
at org.basex.query.scope.MainModule.iter(MainModule.java:97)
at org.basex.query.QueryContext.iter(QueryContext.java:332)
at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90)
at org.basex.core.cmd.AQuery.query(AQuery.java:107)
at org.basex.core.cmd.XQuery.run(XQuery.java:22)
at org.basex.core.Command.run(Command.java:257)
at org.basex.core.Command.execute(Command.java:93)
at org.basex.api.client.LocalSession.execute(LocalSession.java:132)
at org.basex.api.client.Session.execute(Session.java:36)
at org.basex.core.CLI.execute(CLI.java:92)
at org.basex.BaseX.(BaseX.java:100)
at org.basex.BaseX.main(BaseX.java:42)
Caused by: java.nio.file.FileSystemException: [...]: Die Operation ist nicht 
erlaubt
at 
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:288)
at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:476)
at 
java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:263)
at java.base/java.nio.file.Files.move(Files.java:1413)
at org.basex.query.func.file.FileCopy.relocate(FileCopy.java:75)
at org.basex.query.func.file.FileCopy.relocate(FileCopy.java:53)
at org.basex.query.func.file.FileMove.item(FileMove.java:18)
at org.basex.query.func.file.FileFn.item(FileFn.java:25)
... 15 more
org.basex.core.BaseXException: Stopped at ., 1/10:
[file:io-error] [...]: Die Operation ist nicht erlaubt
at org.basex.core.Command.execute(Command.java:94)
at org.basex.api.client.LocalSession.execute(LocalSession.java:132)
at org.basex.api.client.Session.execute(Session.java:36)
at org.basex.core.CLI.execute(CLI.java:92)
at org.basex.BaseX.(BaseX.java:100)
at org.basex.BaseX.main(BaseX.java:42)
Caused by: org.basex.query.QueryException: [...]: Die Operation ist nicht 
erlaubt
at org.basex.query.QueryError.get(QueryError.java:1431)
at org.basex.query.func.file.FileFn.item(FileFn.java:35)
at org.basex.query.func.file.FileCopy.item(FileCopy.java:18)
at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50)
at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45)
at org.basex.query.scope.MainModule.iter(MainModule.java:97)
at org.