[basex-talk] Trigger to apply statements on technical events ?

2015-05-12 Thread cmarchand
 

Hello ! 

I've had this problem : I've forgotten a db:optimize(...) after a delete
nodes operation. The following xquery has been 60 times slower than
before. Is there a way to detect an update operation, and a way to know
on which database the update occurs, to run automatically a
db:optimize(...) each time a update xquery is run ? 

Christophe 

Re: [basex-talk] Trigger to apply statements on technical events ?

2015-05-12 Thread Christian Grün
Hi Christophe,

the AUTOOPTIMIZE option might do what you want [1]: If applied to a
database, it will always be optimized after an update operation.
However, we are also working on the definition of locking operations
[2].

Best,
Christian

[1] http://docs.basex.org/wiki/Options#AUTOOPTIMIZE
[2] https://github.com/BaseXdb/basex/issues/1082


 I've had this problem : I've forgotten a db:optimize(...) after a delete
 nodes operation. The following xquery has been 60 times slower than before.
 Is there a way to detect an update operation, and a way to know on which
 database the update occurs, to run automatically a db:optimize(...) each
 time a update xquery is run ?

 Christophe


Re: [basex-talk] Trigger to apply statements on technical events ?

2015-05-12 Thread Christian Grün
 However, we are also working on the definition of locking operations

Ehrm, database triggers.


 [1] http://docs.basex.org/wiki/Options#AUTOOPTIMIZE
 [2] https://github.com/BaseXdb/basex/issues/1082


 I've had this problem : I've forgotten a db:optimize(...) after a delete
 nodes operation. The following xquery has been 60 times slower than before.
 Is there a way to detect an update operation, and a way to know on which
 database the update occurs, to run automatically a db:optimize(...) each
 time a update xquery is run ?

 Christophe


Re: [basex-talk] EXPath package format

2015-05-12 Thread Christian Grün
   Not between 2 versions not next to each other (20120509 and
 20100107).  But it happens that the change occurred between the latest
 (20120509) and the directly previous one (2010).

Fine!

I have updated the snapshot [1]; both 'content' and the abbrev
directory will now be detected.
Christian

[1] http://files.basex.org/releases/latest/


 So you can
 follow the link Revision markup, which is the diff version from an
 edition against the previous one:
 http://expath.org/spec/pkg/20120509/diff.

   Basically, in addition to the change with the content dir Andy
 reported, there are the following changes in that edition:

 - new DTD and resource components
 - dependency to a specific processor uses a URI
 - new section on URI resolution

   Regards,

 --
 Florent Georges
 http://fgeorges.org/
 http://h2oconsulting.be/


 On 12 May 2015 at 09:52, Christian Grün wrote:
 Hi Florent,

 Thanks for your comment. Do you plan to publish a diff version of the two 
 specs?

 Christian



 On Tue, May 12, 2015 at 9:51 AM, Florent Georges fgeor...@fgeorges.org 
 wrote:
   Hi,

   That's correct Andy, that has changed some time ago, based on some 
 feedback.

   For what it's worth, in the implementation for Saxon and Calabash, I
 support both for a transitional period (if 'content' is there, that's
 the new model, if a dir with the package name exists, then that's the
 old format and I issue a warning but keep going, else it is a format
 error).

   Regards,

 --
 Florent Georges
 http://fgeorges.org/
 http://h2oconsulting.be/


 On 12 May 2015 at 09:30, Christian Grün wrote:
 Hi Andy,

 Thanks for the hint. I will browse through the current and the older
 version of the spec in order to find out what else has changed.

 Christian



 On Mon, May 11, 2015 at 3:42 PM, Andy Bunce bunce.a...@gmail.com wrote:
 Hi,

 It appears the EXPath package format has changed. The current version of 
 the
 spec reads:

 the root of the ZIP file contains a directory named content, containing 
 the
 components and any other file the package needs.

 http://expath.org/spec/pkg#descriptor

 A previous version http://expath.org/spec/pkg/20100107#d2e112 reads

 Alongside this descriptor, the root of the ZIP file contains a directory
 named after the module name (see below) which contains the components and
 any other file the package needs.

 BaseX appears only to support this earlier version. If a package using a
 content folder is installed the following error is reported:

 [bxerr:BXRE0004] Package descriptor: Invalid attribute 'name'

 /Andy


Re: [basex-talk] EXPath package format

2015-05-12 Thread Florent Georges
  Hi,

  That's correct Andy, that has changed some time ago, based on some feedback.

  For what it's worth, in the implementation for Saxon and Calabash, I
support both for a transitional period (if 'content' is there, that's
the new model, if a dir with the package name exists, then that's the
old format and I issue a warning but keep going, else it is a format
error).

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 12 May 2015 at 09:30, Christian Grün wrote:
 Hi Andy,

 Thanks for the hint. I will browse through the current and the older
 version of the spec in order to find out what else has changed.

 Christian



 On Mon, May 11, 2015 at 3:42 PM, Andy Bunce bunce.a...@gmail.com wrote:
 Hi,

 It appears the EXPath package format has changed. The current version of the
 spec reads:

 the root of the ZIP file contains a directory named content, containing the
 components and any other file the package needs.

 http://expath.org/spec/pkg#descriptor

 A previous version http://expath.org/spec/pkg/20100107#d2e112 reads

 Alongside this descriptor, the root of the ZIP file contains a directory
 named after the module name (see below) which contains the components and
 any other file the package needs.

 BaseX appears only to support this earlier version. If a package using a
 content folder is installed the following error is reported:

 [bxerr:BXRE0004] Package descriptor: Invalid attribute 'name'

 /Andy


Re: [basex-talk] EXPath package format

2015-05-12 Thread Florent Georges
  Not between 2 versions not next to each other (20120509 and
20100107).  But it happens that the change occurred between the latest
(20120509) and the directly previous one (2010).  So you can
follow the link Revision markup, which is the diff version from an
edition against the previous one:
http://expath.org/spec/pkg/20120509/diff.

  Basically, in addition to the change with the content dir Andy
reported, there are the following changes in that edition:

- new DTD and resource components
- dependency to a specific processor uses a URI
- new section on URI resolution

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 12 May 2015 at 09:52, Christian Grün wrote:
 Hi Florent,

 Thanks for your comment. Do you plan to publish a diff version of the two 
 specs?

 Christian



 On Tue, May 12, 2015 at 9:51 AM, Florent Georges fgeor...@fgeorges.org 
 wrote:
   Hi,

   That's correct Andy, that has changed some time ago, based on some 
 feedback.

   For what it's worth, in the implementation for Saxon and Calabash, I
 support both for a transitional period (if 'content' is there, that's
 the new model, if a dir with the package name exists, then that's the
 old format and I issue a warning but keep going, else it is a format
 error).

   Regards,

 --
 Florent Georges
 http://fgeorges.org/
 http://h2oconsulting.be/


 On 12 May 2015 at 09:30, Christian Grün wrote:
 Hi Andy,

 Thanks for the hint. I will browse through the current and the older
 version of the spec in order to find out what else has changed.

 Christian



 On Mon, May 11, 2015 at 3:42 PM, Andy Bunce bunce.a...@gmail.com wrote:
 Hi,

 It appears the EXPath package format has changed. The current version of 
 the
 spec reads:

 the root of the ZIP file contains a directory named content, containing the
 components and any other file the package needs.

 http://expath.org/spec/pkg#descriptor

 A previous version http://expath.org/spec/pkg/20100107#d2e112 reads

 Alongside this descriptor, the root of the ZIP file contains a directory
 named after the module name (see below) which contains the components and
 any other file the package needs.

 BaseX appears only to support this earlier version. If a package using a
 content folder is installed the following error is reported:

 [bxerr:BXRE0004] Package descriptor: Invalid attribute 'name'

 /Andy


Re: [basex-talk] Lock/release question

2015-05-12 Thread Christian Grün
Hi France,

Currently, locks are only applicable in WebDAV. An open issue exists
for global lock operations [1]; you are invited to add your comments.

Best,
Christian

[1] https://github.com/BaseXdb/basex/issues/1083



On Tue, May 12, 2015 at 1:02 AM, France Baril
france.ba...@architextus.com wrote:
 Hi,

 I am trying to find documentation on functions to explicitly lock/unlock
 specific files stored in BaseX for a predefined user. Something like:
 db:lock('db, 'file.xml', 'user', 'write')

 Something like:
 db:get-lock-details('db', 'file.xml') would be interesting too.

 I couldn't find anything. Am I supposed to work with the ~webdav DB? We're
 trying to get away from the WebDAV interface.

 Thanks,

 France

 --
 France Baril
 Architecte documentaire / Documentation architect
 france.ba...@architextus.com


Re: [basex-talk] EXPath package format

2015-05-12 Thread Christian Grün
Hi Andy,

Thanks for the hint. I will browse through the current and the older
version of the spec in order to find out what else has changed.

Christian



On Mon, May 11, 2015 at 3:42 PM, Andy Bunce bunce.a...@gmail.com wrote:
 Hi,

 It appears the EXPath package format has changed. The current version of the
 spec reads:

 the root of the ZIP file contains a directory named content, containing the
 components and any other file the package needs.

 http://expath.org/spec/pkg#descriptor

 A previous version http://expath.org/spec/pkg/20100107#d2e112 reads

 Alongside this descriptor, the root of the ZIP file contains a directory
 named after the module name (see below) which contains the components and
 any other file the package needs.

 BaseX appears only to support this earlier version. If a package using a
 content folder is installed the following error is reported:

 [bxerr:BXRE0004] Package descriptor: Invalid attribute 'name'

 /Andy


Re: [basex-talk] Increasing memory allocated to BaseX

2015-05-12 Thread Christian Grün
Hi Steve,

It can happen that a query leads to Out Of Memory when using the GUI,
whereas it runs fine on command-line. The reason is that results on
command-line (or various other APIs) are returned one by one, and in
the GUI they will be cached.

However, if you assign more memory to the JVM, it should always be
utilized by BaseX. If you want to observe memory consumption while the
query is running, you could open the memory dialog by pressing on the
memory bar in the lower right corner. This dialog will also tell you
if your JVM option was correctly detected. You could also open the
Java tool jvisualvm while the query is running and see what's going
on. If OOM occurs too soon, you can slow down processing by adding
some prof:sleep(...) in your query.

Hope this helps,
Christian


On Tue, May 12, 2015 at 4:17 PM, Steve Baskauf
steve.bask...@vanderbilt.edu wrote:
 I am running BaseX 8.1 on a Win7 machine with 8GB memory.  I have a query
 that loads data from several CSV files, then generates a RDF/XML dump into a
 single, very large file (137 lines).  When I run the query using the
 BaseX GUI, I get an Out of Main Memory error.  I am able to get the query
 to complete via the command line, which is fine for the moment, but if the
 database gets larger, I'm anticipating that I won't be able to use it.  An
 obvious solution would be to generate several smaller files, but the real
 problem is that BaseX doesn't seem to be utilizing all of the available
 memory.  When I monitored memory utilization, it was only utilizing a small
 fraction of the available memory.  I tried increasing the allocated memory
 by changing the
 BASEX_JVM=-Xmx512m
 to
 BASEX_JVM=-Xmx1024m
 line in the basex.bat and basexgui.bat files, but that didn't seem to have
 any effect - I still run out of memory and there is plenty of unused memory
 in the system.  I must be missing something.  Is there a simple change that
 I can make to make more memory available to BaseX?

 For reference purposes, the query I'm running is at
 https://github.com/baskaufs/test/blob/master/image-all-hack.xq

 Steve Baskauf



Re: [basex-talk] Basex Standalone : [bxerr:BXSQ0007] Could not initialize supplied driver: 'com.mysql.jdbc.Driver'

2015-05-12 Thread jean-marc Mercier
Christian,

Hello. Thx for your answer. I've tried your suggestion, but I can't set the
Java Build path using Eclipse/ Project / Properties (my IDE is eclipse
together with BaseX Interpreter) :
[image: Images intégrées 1]
This is a minor issue : I can survive using the BaseX server. It is only
hardening dev / debug, since I don't know how to trace using BAseX server
(fn:trace seems not to output anything using the basex server, maybe I
missed something here ?).

Cheers


2015-05-11 22:05 GMT+02:00 Christian Grün christian.gr...@gmail.com:

 Hi Jean-Marc,

  I guess that it might be due to the fact that I don't know how to include
  multiple jar while using with eclipse. I tried to go to
  Windows/Preferences/XQUERY/Interpreters and set -classpath
  {BaseXDirectory}\lib\*, but it does not work.

 You will probably have to include the libraries as follows:

   Project → Properties → Java Build Path →
   Libraries → Add JARs...

 Hope this helps,
 Christian



 
  Maybe somebody already met this small issue before ?
 
  Thanks for your answer,
 
  cheers



Re: [basex-talk] EXPath package format

2015-05-12 Thread Florent Georges
38 minutes between the email with the links, and a new build being
publicly released on the website.  BaseX and Saxon are the 2 most
incredibly reactive companies to solve stuff! (and BaseX always makes
them available on a public snapshot!)

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/


On 12 May 2015 at 10:46, Christian Grün wrote:
   Not between 2 versions not next to each other (20120509 and
 20100107).  But it happens that the change occurred between the latest
 (20120509) and the directly previous one (2010).

 Fine!

 I have updated the snapshot [1]; both 'content' and the abbrev
 directory will now be detected.
 Christian

 [1] http://files.basex.org/releases/latest/


 So you can
 follow the link Revision markup, which is the diff version from an
 edition against the previous one:
 http://expath.org/spec/pkg/20120509/diff.

   Basically, in addition to the change with the content dir Andy
 reported, there are the following changes in that edition:

 - new DTD and resource components
 - dependency to a specific processor uses a URI
 - new section on URI resolution

   Regards,

 --
 Florent Georges
 http://fgeorges.org/
 http://h2oconsulting.be/


 On 12 May 2015 at 09:52, Christian Grün wrote:
 Hi Florent,

 Thanks for your comment. Do you plan to publish a diff version of the two 
 specs?

 Christian



 On Tue, May 12, 2015 at 9:51 AM, Florent Georges fgeor...@fgeorges.org 
 wrote:
   Hi,

   That's correct Andy, that has changed some time ago, based on some 
 feedback.

   For what it's worth, in the implementation for Saxon and Calabash, I
 support both for a transitional period (if 'content' is there, that's
 the new model, if a dir with the package name exists, then that's the
 old format and I issue a warning but keep going, else it is a format
 error).

   Regards,

 --
 Florent Georges
 http://fgeorges.org/
 http://h2oconsulting.be/


 On 12 May 2015 at 09:30, Christian Grün wrote:
 Hi Andy,

 Thanks for the hint. I will browse through the current and the older
 version of the spec in order to find out what else has changed.

 Christian



 On Mon, May 11, 2015 at 3:42 PM, Andy Bunce bunce.a...@gmail.com wrote:
 Hi,

 It appears the EXPath package format has changed. The current version of 
 the
 spec reads:

 the root of the ZIP file contains a directory named content, containing 
 the
 components and any other file the package needs.

 http://expath.org/spec/pkg#descriptor

 A previous version http://expath.org/spec/pkg/20100107#d2e112 reads

 Alongside this descriptor, the root of the ZIP file contains a directory
 named after the module name (see below) which contains the components and
 any other file the package needs.

 BaseX appears only to support this earlier version. If a package using a
 content folder is installed the following error is reported:

 [bxerr:BXRE0004] Package descriptor: Invalid attribute 'name'

 /Andy


Re: [basex-talk] Basex Standalone : [bxerr:BXSQ0007] Could not initialize supplied driver: 'com.mysql.jdbc.Driver'

2015-05-12 Thread Christian Grün
You may need to create a Java project and try it again. Please note that,
from the Eclipse perspective, the XQuery processor of BaseX is a Java
application.



On Tue, May 12, 2015 at 11:28 AM, jean-marc Mercier 
jeanmarc.merc...@gmail.com wrote:

 Christian,

 Hello. Thx for your answer. I've tried your suggestion, but I can't set
 the Java Build path using Eclipse/ Project / Properties (my IDE is
 eclipse together with BaseX Interpreter) :
 [image: Images intégrées 1]
 This is a minor issue : I can survive using the BaseX server. It is only
 hardening dev / debug, since I don't know how to trace using BAseX server
 (fn:trace seems not to output anything using the basex server, maybe I
 missed something here ?).

 Cheers


 2015-05-11 22:05 GMT+02:00 Christian Grün christian.gr...@gmail.com:

 Hi Jean-Marc,

  I guess that it might be due to the fact that I don't know how to
 include
  multiple jar while using with eclipse. I tried to go to
  Windows/Preferences/XQUERY/Interpreters and set -classpath
  {BaseXDirectory}\lib\*, but it does not work.

 You will probably have to include the libraries as follows:

   Project → Properties → Java Build Path →
   Libraries → Add JARs...

 Hope this helps,
 Christian



 
  Maybe somebody already met this small issue before ?
 
  Thanks for your answer,
 
  cheers





Re: [basex-talk] Add metadata to a group of documents inside the database

2015-05-12 Thread Menashè Eliezer

Hi Christian,

Thank you very much for your reply!
As for path: A database is created from all files in a specific folder 
which has subfolders 'group1', 'group2' etc. and the path is derived 
from these subfolders of adding files to db?


With kind regards,
Menashè

On 05/12/2015 02:19 PM, Christian Grün wrote:

Hi Menashè,

Just use different database paths for each group (e.g. '/path1/' and
'/path2/'), and specify the sub path with db:open:

   db:open('db', '/path1')/...

You can also store the documents in two separate databases and use a
single XQuery expression to query all documents:

   for $db in ('db1', 'db2')
   return db:open($db)/...

Hope this helps,
Christian


On Tue, May 12, 2015 at 2:14 PM, Menashè Eliezer
melie...@ogs.trieste.it wrote:

Hello,
I have two groups of xml to be included in the same database.
Usually the same query will be performed on both of them, but I need to able
to query only one group.
The difference between the groups is known only to add the xml files, e.g.
the origin of the files. This information is not found inside the files, and
I prefer not modifying their content.

I was hoping to be able to define groups, using subfolders and base-uri or
multiple collections, but I know it's not possible using Basex.
Maybe I can tag them? The group type is both a property and a possible
filter in a query, so I need a good performance.

Right now I see two alternatives:
1. Using two separate databases. Once I need to query all files, I'll make
the same query on multiple databases...
2. One database, but a query to a new xml document, which includes list of
node-ids per group type, will be used both for knowing the type and for
querying a subset.

Any ideas, please?

--
With kind regards,
Menashè





[basex-talk] Add metadata to a group of documents inside the database

2015-05-12 Thread Menashè Eliezer

Hello,
I have two groups of xml to be included in the same database.
Usually the same query will be performed on both of them, but I need to 
able to query only one group.
The difference between the groups is known only to add the xml files, 
e.g. the origin of the files. This information is not found inside the 
files, and I prefer not modifying their content.


I was hoping to be able to define groups, using subfolders and base-uri 
or multiple collections, but I know it's not possible using Basex.
Maybe I can tag them? The group type is both a property and a possible 
filter in a query, so I need a good performance.


Right now I see two alternatives:
1. Using two separate databases. Once I need to query all files, I'll 
make the same query on multiple databases...
2. One database, but a query to a new xml document, which includes list 
of node-ids per group type, will be used both for knowing the type and 
for querying a subset.


Any ideas, please?

--
With kind regards,
Menashè



Re: [basex-talk] Add metadata to a group of documents inside the database

2015-05-12 Thread Christian Grün
If you create a database with a single CREATE or db:create call, the
resulting path structure will reflect the original directory
structure. However, you can also add files and directories to specific
target paths in a second steps, e.g. via db:add [1]. Our Wiki should
contain all relevant information (see e.g. [2]).

[1] http://docs.basex.org/wiki/Database_Module#db:add
[2] http://docs.basex.org/wiki/Databases


On Tue, May 12, 2015 at 2:35 PM, Menashè Eliezer
melie...@ogs.trieste.it wrote:
 Hi Christian,

 Thank you very much for your reply!
 As for path: A database is created from all files in a specific folder which
 has subfolders 'group1', 'group2' etc. and the path is derived from these
 subfolders of adding files to db?

 With kind regards,
 Menashè


 On 05/12/2015 02:19 PM, Christian Grün wrote:

 Hi Menashè,

 Just use different database paths for each group (e.g. '/path1/' and
 '/path2/'), and specify the sub path with db:open:

db:open('db', '/path1')/...

 You can also store the documents in two separate databases and use a
 single XQuery expression to query all documents:

for $db in ('db1', 'db2')
return db:open($db)/...

 Hope this helps,
 Christian


 On Tue, May 12, 2015 at 2:14 PM, Menashè Eliezer
 melie...@ogs.trieste.it wrote:

 Hello,
 I have two groups of xml to be included in the same database.
 Usually the same query will be performed on both of them, but I need to
 able
 to query only one group.
 The difference between the groups is known only to add the xml files,
 e.g.
 the origin of the files. This information is not found inside the files,
 and
 I prefer not modifying their content.

 I was hoping to be able to define groups, using subfolders and base-uri
 or
 multiple collections, but I know it's not possible using Basex.
 Maybe I can tag them? The group type is both a property and a possible
 filter in a query, so I need a good performance.

 Right now I see two alternatives:
 1. Using two separate databases. Once I need to query all files, I'll
 make
 the same query on multiple databases...
 2. One database, but a query to a new xml document, which includes list
 of
 node-ids per group type, will be used both for knowing the type and for
 querying a subset.

 Any ideas, please?

 --
 With kind regards,
 Menashè




Re: [basex-talk] Add metadata to a group of documents inside the database

2015-05-12 Thread Christian Grün
Hi Menashè,

Just use different database paths for each group (e.g. '/path1/' and
'/path2/'), and specify the sub path with db:open:

  db:open('db', '/path1')/...

You can also store the documents in two separate databases and use a
single XQuery expression to query all documents:

  for $db in ('db1', 'db2')
  return db:open($db)/...

Hope this helps,
Christian


On Tue, May 12, 2015 at 2:14 PM, Menashè Eliezer
melie...@ogs.trieste.it wrote:
 Hello,
 I have two groups of xml to be included in the same database.
 Usually the same query will be performed on both of them, but I need to able
 to query only one group.
 The difference between the groups is known only to add the xml files, e.g.
 the origin of the files. This information is not found inside the files, and
 I prefer not modifying their content.

 I was hoping to be able to define groups, using subfolders and base-uri or
 multiple collections, but I know it's not possible using Basex.
 Maybe I can tag them? The group type is both a property and a possible
 filter in a query, so I need a good performance.

 Right now I see two alternatives:
 1. Using two separate databases. Once I need to query all files, I'll make
 the same query on multiple databases...
 2. One database, but a query to a new xml document, which includes list of
 node-ids per group type, will be used both for knowing the type and for
 querying a subset.

 Any ideas, please?

 --
 With kind regards,
 Menashè



[basex-talk] Increasing memory allocated to BaseX

2015-05-12 Thread Steve Baskauf
I am running BaseX 8.1 on a Win7 machine with 8GB memory.  I have a 
query that loads data from several CSV files, then generates a RDF/XML 
dump into a single, very large file (137 lines).  When I run the 
query using the BaseX GUI, I get an Out of Main Memory error.  I am 
able to get the query to complete via the command line, which is fine 
for the moment, but if the database gets larger, I'm anticipating that I 
won't be able to use it.  An obvious solution would be to generate 
several smaller files, but the real problem is that BaseX doesn't seem 
to be utilizing all of the available memory.  When I monitored memory 
utilization, it was only utilizing a small fraction of the available 
memory.  I tried increasing the allocated memory by changing the

BASEX_JVM=-Xmx512m
to
BASEX_JVM=-Xmx1024m
line in the basex.bat and basexgui.bat files, but that didn't seem to 
have any effect - I still run out of memory and there is plenty of 
unused memory in the system.  I must be missing something.  Is there a 
simple change that I can make to make more memory available to BaseX?


For reference purposes, the query I'm running is at
https://github.com/baskaufs/test/blob/master/image-all-hack.xq

Steve Baskauf



Re: [basex-talk] Add metadata to a group of documents inside the database

2015-05-12 Thread Lizzi, Vincent
Menashè,

In similar situations I've used a second database to store metadata at the same 
path as the document in the primary database. For example:

db:open('database', '/path/a.xml')
db:open('database_metadata', '/path/a.xml')

Also, there is a feature request for adding properties as additional metadata 
for documents in the database:

https://github.com/BaseXdb/basex/issues/988

If I may ask, what metadata information do you need to record about each 
document?

Vincent



-Original Message-
From: basex-talk-boun...@mailman.uni-konstanz.de 
[mailto:basex-talk-boun...@mailman.uni-konstanz.de] On Behalf Of Christian Grün
Sent: Tuesday, May 12, 2015 8:41 AM
To: Menashè Eliezer
Cc: BaseX
Subject: Re: [basex-talk] Add metadata to a group of documents inside the 
database

If you create a database with a single CREATE or db:create call, the resulting 
path structure will reflect the original directory structure. However, you can 
also add files and directories to specific target paths in a second steps, e.g. 
via db:add [1]. Our Wiki should contain all relevant information (see e.g. [2]).

[1] http://docs.basex.org/wiki/Database_Module#db:add
[2] http://docs.basex.org/wiki/Databases


On Tue, May 12, 2015 at 2:35 PM, Menashè Eliezer melie...@ogs.trieste.it 
wrote:
 Hi Christian,

 Thank you very much for your reply!
 As for path: A database is created from all files in a specific folder 
 which has subfolders 'group1', 'group2' etc. and the path is derived 
 from these subfolders of adding files to db?

 With kind regards,
 Menashè


 On 05/12/2015 02:19 PM, Christian Grün wrote:

 Hi Menashè,

 Just use different database paths for each group (e.g. '/path1/' and 
 '/path2/'), and specify the sub path with db:open:

db:open('db', '/path1')/...

 You can also store the documents in two separate databases and use a 
 single XQuery expression to query all documents:

for $db in ('db1', 'db2')
return db:open($db)/...

 Hope this helps,
 Christian


 On Tue, May 12, 2015 at 2:14 PM, Menashè Eliezer 
 melie...@ogs.trieste.it wrote:

 Hello,
 I have two groups of xml to be included in the same database.
 Usually the same query will be performed on both of them, but I need 
 to able to query only one group.
 The difference between the groups is known only to add the xml 
 files, e.g.
 the origin of the files. This information is not found inside the 
 files, and I prefer not modifying their content.

 I was hoping to be able to define groups, using subfolders and 
 base-uri or multiple collections, but I know it's not possible using 
 Basex.
 Maybe I can tag them? The group type is both a property and a 
 possible filter in a query, so I need a good performance.

 Right now I see two alternatives:
 1. Using two separate databases. Once I need to query all files, 
 I'll make the same query on multiple databases...
 2. One database, but a query to a new xml document, which includes 
 list of node-ids per group type, will be used both for knowing the 
 type and for querying a subset.

 Any ideas, please?

 --
 With kind regards,
 Menashè




Re: [basex-talk] Basex Standalone : [bxerr:BXSQ0007] Could not initialize supplied driver: 'com.mysql.jdbc.Driver'

2015-05-12 Thread Christian Grün
Hm, this is probably something we cannot control. The stack trace
points to the JLine library; maybe you can exclude this library?


On Tue, May 12, 2015 at 12:27 PM, jean-marc Mercier
jeanmarc.merc...@gmail.com wrote:

 Well I tried to add all JAR contained in the BaseX\lib in this windows. If I 
 try to launch a XQUERY script with this running configuration, here is the 
 result

 [ERROR] Terminal initialization failed; falling back to unsupported
 java.lang.NoClassDefFoundError: Could not initialize class 
 org.fusesource.jansi.internal.Kernel32
 at 
 org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(WindowsSupport.java:50)
 at jline.WindowsTerminal.getConsoleMode(WindowsTerminal.java:204)
 at jline.WindowsTerminal.init(WindowsTerminal.java:82)
 at jline.TerminalFactory.create(TerminalFactory.java:101)
 at jline.TerminalFactory.get(TerminalFactory.java:158)
 at jline.console.ConsoleReader.init(ConsoleReader.java:229)
 at jline.console.ConsoleReader.init(ConsoleReader.java:221)
 at jline.console.ConsoleReader.init(ConsoleReader.java:209)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
 at java.lang.reflect.Constructor.newInstance(Unknown Source)
 at java.lang.Class.newInstance(Unknown Source)
 at 
 org.basex.util.ConsoleReader$JLineConsoleReader.init(ConsoleReader.java:132)
 at org.basex.util.ConsoleReader.get(ConsoleReader.java:57)
 at org.basex.BaseX.console(BaseX.java:183)
 at org.basex.BaseX.init(BaseX.java:169)
 at org.basex.BaseX.main(BaseX.java:42)


 2015-05-12 12:07 GMT+02:00 Christian Grün christian.gr...@gmail.com:

 Just a guess, but have you already tried to add all the additional BaseX 
 libraries in this window (Add JARs...)?


 On Tue, May 12, 2015 at 12:01 PM, jean-marc Mercier 
 jeanmarc.merc...@gmail.com wrote:

 Christian,

 Hi. I confess that I don't know how to set a JAVA project running XQUERY 
 with Basex interpreter under eclipse.
 I just know how to set an XQUERY project as pointed in 
 http://docs.basex.org/wiki/Integrating_Eclipse.

 Maybe a possibility to avoid changing my whole project setting could be use 
 an alternative Eclipse running Configuration ?


 I've tried but didn't find out so far how to set it properly.


 2015-05-12 11:31 GMT+02:00 Christian Grün christian.gr...@gmail.com:

 You may need to create a Java project and try it again. Please note that, 
 from the Eclipse perspective, the XQuery processor of BaseX is a Java 
 application.



 On Tue, May 12, 2015 at 11:28 AM, jean-marc Mercier 
 jeanmarc.merc...@gmail.com wrote:

 Christian,

 Hello. Thx for your answer. I've tried your suggestion, but I can't set 
 the Java Build path using Eclipse/ Project / Properties (my IDE is 
 eclipse together with BaseX Interpreter) :

 This is a minor issue : I can survive using the BaseX server. It is only 
 hardening dev / debug, since I don't know how to trace using BAseX server 
 (fn:trace seems not to output anything using the basex server, maybe I 
 missed something here ?).

 Cheers


 2015-05-11 22:05 GMT+02:00 Christian Grün christian.gr...@gmail.com:

 Hi Jean-Marc,

  I guess that it might be due to the fact that I don't know how to 
  include
  multiple jar while using with eclipse. I tried to go to
  Windows/Preferences/XQUERY/Interpreters and set -classpath
  {BaseXDirectory}\lib\*, but it does not work.

 You will probably have to include the libraries as follows:

   Project → Properties → Java Build Path →
   Libraries → Add JARs...

 Hope this helps,
 Christian



 
  Maybe somebody already met this small issue before ?
 
  Thanks for your answer,
 
  cheers








Re: [basex-talk] Basex Standalone : [bxerr:BXSQ0007] Could not initialize supplied driver: 'com.mysql.jdbc.Driver'

2015-05-12 Thread Christian Grün
 I've tried to pass the Program argument EXECUTE ${query_file} as arguments, 
 replies [XPDY0002] EXECUTE: no context value bound

You'd need to use the -c flag if you want to launch BaseX commands
such as EXECUTE. What happens if you simply get rid of the EXECUTE
string? See the documentation for more info [1]...

Christian

[1] http://docs.basex.org/wiki/Command-Line_Options#Standalone


What's the content of your command script?






 BaseX 8.0 beta [Standalone]
 Try help to get more information.

  help
 Try HELP [...] to get info on a specific command.

 ADD (TO [path]) [input]
   Add resource to database.
 ALTER [DATABASE|PASSWORD|USER] [...]
   Alter database or user data.
 CHECK [input]
   Open or create database.
 CLOSE
   Close current database.
 COPY [name] [newname]
   Copy database.
 CREATE [BACKUP|DATABASE|EVENT|INDEX|USER] [...]
   Create database, index, user, backup or event.
 DELETE [path]
   Delete resources from database.
 DROP [BACKUP|DATABASE|EVENT|INDEX|USER] [...]
   Drop database, index, user, backup or event.
 EXIT
   Exit application.
 EXPORT [path]
   Export database to XML.
 FIND [keywords]
   Run a keyword query.
 FLUSH
   Flush database.
 GET [option]
   Show global option.
 GRANT [NONE|READ|WRITE|CREATE|ADMIN] (ON [pattern]) TO [user]
   Grant user permissions.
 HELP ([command])
   Get help on BaseX commands.
 INFO ([DATABASE|INDEX|STORAGE])
   Show information on current database.
 INSPECT
   Perform integrity checks.
 KILL [name]
   Kill user sessions.
 LIST ([name] ([path]))
   List databases or resources of database.
 OPEN [name] ([path])
   Open database.
 OPTIMIZE (ALL)
   Optimize the database.
 PASSWORD ([password])
   Change password.
 QUIT
   Exit application.
 RENAME [path] [newpath]
   Rename resources in database.
 REPLACE [path] [input]
   Replace resources in database.
 REPO [DELETE|INSTALL|LIST]
   Install, delete or list packages.
 RESTORE [name-(date)]
   Restore database.
 RETRIEVE [path]
   Retrieve raw data.
 RUN [path]
   Run query or command script.
 EXECUTE [input]
   Execute command script.
 SET [option] ([value])
   Set global options.
 SHOW [BACKUPS|EVENTS|SESSIONS|USERS]
   Show server information.
 STORE (TO [path]) [input]
   Store raw data.
 TEST [path]
   Run XQUnit tests.
 XQUERY [query]
   Run XQuery.
 

 2015-05-12 12:50 GMT+02:00 Christian Grün christian.gr...@gmail.com:

 Hm, this is probably something we cannot control. The stack trace
 points to the JLine library; maybe you can exclude this library?


 On Tue, May 12, 2015 at 12:27 PM, jean-marc Mercier
 jeanmarc.merc...@gmail.com wrote:
 
  Well I tried to add all JAR contained in the BaseX\lib in this windows. If 
  I try to launch a XQUERY script with this running configuration, here is 
  the result
 
  [ERROR] Terminal initialization failed; falling back to unsupported
  java.lang.NoClassDefFoundError: Could not initialize class 
  org.fusesource.jansi.internal.Kernel32
  at 
  org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(WindowsSupport.java:50)
  at jline.WindowsTerminal.getConsoleMode(WindowsTerminal.java:204)
  at jline.WindowsTerminal.init(WindowsTerminal.java:82)
  at jline.TerminalFactory.create(TerminalFactory.java:101)
  at jline.TerminalFactory.get(TerminalFactory.java:158)
  at jline.console.ConsoleReader.init(ConsoleReader.java:229)
  at jline.console.ConsoleReader.init(ConsoleReader.java:221)
  at jline.console.ConsoleReader.init(ConsoleReader.java:209)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
  Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at java.lang.Class.newInstance(Unknown Source)
  at 
  org.basex.util.ConsoleReader$JLineConsoleReader.init(ConsoleReader.java:132)
  at org.basex.util.ConsoleReader.get(ConsoleReader.java:57)
  at org.basex.BaseX.console(BaseX.java:183)
  at org.basex.BaseX.init(BaseX.java:169)
  at org.basex.BaseX.main(BaseX.java:42)
 
 
  2015-05-12 12:07 GMT+02:00 Christian Grün christian.gr...@gmail.com:
 
  Just a guess, but have you already tried to add all the additional BaseX 
  libraries in this window (Add JARs...)?
 
 
  On Tue, May 12, 2015 at 12:01 PM, jean-marc Mercier 
  jeanmarc.merc...@gmail.com wrote:
 
  Christian,
 
  Hi. I confess that I don't know how to set a JAVA project running XQUERY 
  with Basex interpreter under eclipse.
  I just know how to set an XQUERY project as pointed in 
  http://docs.basex.org/wiki/Integrating_Eclipse.
 
  Maybe a possibility to avoid changing my whole project setting could be 
  use an alternative Eclipse running Configuration ?
 
 
  I've tried but didn't find out so far how to set it properly.
 
 
  2015-05-12 11:31 GMT+02:00 Christian Grün christian.gr...@gmail.com:
 
  You may need to create a Java project and try it again. Please note 
  that, from the Eclipse