Re: [basex-talk] BaseX - questions about few issues

2017-06-06 Thread Dirk Kirsten
Dear Radim,

just two little additions to Christians excellent answer: If you are
able to decrypt a salted SHA356 hashed password in "a few seconds"
please tell me how - Man, that would be a hack worth millions of dollars
so I would like to cash in ;)

On a more serious note: Keep in mind although we do not have AD support
now, it is always possible to sponsor a feature, i.e. giving us some
money (this is were the millions of money from the SHA256 hack come in
handy!) so we have the time to develop this feature. Of course it is
also always possible to add this feature yourself and send us a pull
request.

Cheers

Dirk


On 06/05/2017 11:37 AM, Christian Grün wrote:
> Dear Radim,
>
> Welcome to the list.
>
>> 1) BaseX GUI is automatically opened with administration permissions without
>> any login request. Can it be fixed?
> As the GUI has been designed for local standalone usage, no user can
> be specified. If you plan to use BaseX in a distributed environment,
> the DBA web interface may be the better choice.
>
>
>> 2) Once user is created in a database, he or she has the same rights in all
>> databases. Can it be fixed so the user has particular permisssion per
>> database?
> That’s possible. By default, new users have no permissions, and you
> can assign user names and patterns to databases [1].
>
>> 3) Or better, would it be posssible to set user permission per collection
>> (like in Sedna or MonoDB)?
> In BaseX, user permissions are always defined for databases.
>
>> 4) I can see the users are stored in users.xml file, including with their
>> permission and hashed password. It is a security issue for us because the
>> digest hash can be decrypted in few seconds. Is it possible to obscure that
>> sensitive information, or to not store it in the file?
> How would you proceed to decode it that quickly? – The digest hash is
> only required for HTTP digest authentication; feel free to remove it
> from the users.xml file.
>
>
>> 5) All queries are stored in logs. Queries for user creation or password
>> change are stored in plain text there. Is there a way to obscure that
>> sensitive information?
> Passwords won’t be stored in the logs, so you’ll be safe.
>
>
>> 6) It only is possible to create BaseX users. Is Active Directory account
>> support in road-map, especially support for AD groups? It would be much
>> appreciated.
> Not yet. Sorry, I cannot give you any timeline, because it currently
> has no high priority for us.
>
>
>> 7) BaseX supports http protocol. Is it possible to make it work with https
>> protocol as well?
> Absolutely.
>
> Hope this helps,
> Christian
>
> [1] http://docs.basex.org/wiki/User_Management

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] File name changed

2017-05-11 Thread Dirk Kirsten
Hi Guiseppe,

well, BaseX is smart and figures out that 6-2 is 4 ;) When you just use
the numbers, XQuery will assume it is an xs:integer, so accordingly it
will compute the result. If you want to use it as string you have to
enclose it in "", i.e.

"/cluster/home/g/results2/" || "6-2" || ".xml"

although the concatenation in this case would not be necessary.

Cheers

Dirk


On 05/11/2017 10:11 AM, cel...@informatik.uni-leipzig.de wrote:
>
> Hi All,
>
> It is not clear to me why, when I tried to save the result of one
> query in a file called 6-2.xml, BaseX automatically converted this
> name into 4.xml. Similar name changes happened with files I wanted to
> name 1-2.xml and 10-2.xml.
>
> I attach part of the query info output (with highlights for the
> relevant points)
>
> Query:
> declare variable $pp := doc("/cluster/home/g/files/all.xml")/d/t; for
> $s at $c in collection("/cluster/home/g/files/splitted-db/")[6] return
> file:write("/cluster/home/g/results2/" || 6-2 || ".xml", { for
> $e in $s//d let $db := $pp[$e/p = ./p and $e/f = ./f] return if ($db)
> then element d {$e/@*, $e/*, for $u in $db/l return element e
> {$u/text()}} else $e } )
>
> Compiling:
> - pre-evaluating doc("/cluster/home/g/files/all.xml")
> - pre-evaluating collection("/cluster/home/g/files/splitted-db/")
> - rewriting ((db:open-pre("splitted-db",0), ...))[position() = 6]
> - type check removed: $c_2 as xs:integer
> - pre-evaluating (6 - 2)
> - pre-evaluating concat("/cluster/home/g/results2/", 4, ".xml")
> - rewriting descendant-or-self step(s)
> - swapping operands: (p = $e_3/*:p)
> - swapping operands: (f = $e_3/*:f)
> - rewriting ((p = $e_3/*:p) and (f = $e_3/*:f)) to predicate(s)
> - pre-evaluating boolean((p = $e_3/*:p))
> - pre-evaluating boolean((f = $e_3/*:f))
> - rewriting singleton for to let
> - inlining $s_1
> - converting descendant::*:d to child steps
> - inlining $c_2
> - simplifying flwor expression
>
> Best,
> Giuseppe
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Characters allowed in database names

2017-04-12 Thread Dirk Kirsten
Hello Bram,

at least the documentation seems to reflect that:
http://docs.basex.org/wiki/Commands#Valid_Names. It is also linked
within http://docs.basex.org/wiki/Commands#CREATE_DB, so I think the
documentation is hard to improve.

However, I agree that the error message should be improved.

And you have some weird database names...

Cheers

Dirk

On 04/12/2017 02:04 PM, Bram Vanroy wrote:
>
> Hello, list
>
>  
>
> Upon creating specific database names I came across the following
> issue: when creating a database named ‘’wrpee|advp|hd%bw” (without
> quotes) from the CREATE command I got the basic ‘how to use CREATE’
> screen in my terminal. This would seem to indicate that my syntax is
> wrong, even though “CREATE DATABASE wrpee|advp|hd%bw
> C:\\sonar\\grinded\\WRPEE\\advp\\ advp|hd%bw.xml” is syntactically
> valid (two arguments for CREATE DATABASE).
>
>  
>
> The issue seems to be in the database name. The pipe | is not allowed,
> it seems. When replaced by a dash “-“ it works as expected. However, I
> cannot find this documented anywhere. Is it possible to make the error
> message more clear, e.g. ‘invalid database name’, or at least update
> the documentation on this? Which characters are allowed, and which aren’t?
>
>  
>
>  
>
> Thanks in advance,
>
> Kind regards
>
>  
>
> Bram Vanroy
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] systemd basex.service ubuntu 16.04

2017-04-10 Thread Dirk Kirsten
Hello Steven,

it really shouldn't be to hard to write your little systemd service
file. For example, my service file basexserver looks like this:

[Unit]
Description=BaseX database server

[Service]
PIDFile=/var/run/basex.pid
ExecStart=/opt/basex/bin/basexserver

[Install]
WantedBy=multi-user.target

Adapt this to your needs for basexhttp. I am sure there are also many
other possible configuration parameters you might want to add, but it
might be the easiest if you check the systemd help for that.

On 04/10/2017 10:50 AM, Stephen White wrote:
>
> Does anyone have a working combination for launch basexhttp as a
> service using systemd?
>
> If not, what is the suggested method to auto launch on reboot.
>
> Cheers,
> Steve

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Basexhttp on ubuntu

2017-03-12 Thread Dirk Kirsten
Hi Trevor,

the repository usually contains quite outdated versions of BaseX (and in
this case, it apparently does not include basex-api). I would recommend
you to download the zip version at
http://basex.org/products/download/all-downloads/ and simply run the
scripts within the bin folder.

Cheers

Dirk


On 03/12/2017 07:43 PM, Trevor Sewell wrote:
> I’ve Installed base via apt on ubuntu 16.10
> I can run basex, basexserver but not basexhttp, 
> the command is not found
>
> please advise

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Flush command and data corruption

2017-03-09 Thread Dirk Kirsten
Hello Colin,

this really sounds like a bug on our side to me. I opened a bug report
on https://github.com/BaseXdb/basex/issues/1434 and I am sure Christian
will quickly fix it when he gets back from a short vacation.

Cheers

Dirk


On 03/08/2017 06:20 PM, Colin Delacroix wrote:
> Hi everyone,
>
> (warning this is a long read)
>
> I'm using server version 8.6.1 and writing a Java client to move lots
> of documents from a SQL database to a BaseX database.
> The basic version works just fine. Tested up to 1M documents.
>
> Now I'm trying to do exactly the same but with AUTOFLUSH disabled +
> manually FLUSH every N documents and it fails after just a few inserts.
>
> Pseudo code:
> (set up client session, create and open new database)
> session.execute(new Set(MainOptions.AUTOFLUSH, false));
> int i = 0;
> while(doc = nextDocs()) {
>   session.add(doc.getKey(), doc.getInputStream());
>   if(i++ % 10 == 0) { /* value reduced to 10 for testing purposes */
> session.execute(new Flush());
>   }
> }
> (tear down session)
>
> Remember tha
>
> After the first FLUSH has been issued, the ADD  directive starts
> randomly throwing a org.basex.core.BaseXException (when using the
> BaseXClient implementation it was its inner ok() method that started
> returning false).
>
> I tracked the root cause in the server: the SAXParser complaining
> about the documents not being well-formed (the exact same documents
> are all imported fine with AUTOFLUSH on). In the server standard logs
> I can see why: parts of those documents are suddenly missing (usually
> the beginning + command part) at parse time!
>
> That is the symptom, now for the cause I'm also observing that the ADD
> and FLUSH directive in the logs are out of order, exactly like what
> would happen in the FLUSH commands were not properly queued.
>
> I was expecting something like :
> ADD
> ADD
> ADD
> (N times)
> FLUSH
> ADD
> ADD
> ADD
> (N times)
> FLUSH
> etc.
>
> Instead I'm observing 
> ADD
> FLUSH
> ADD
> FLUSH
> ADD
> FLUSH
> (etc)
> then 
> ADD
> ADD
> ADD
> (lots of them)
> ERROR
>
>
> So for now I'm keeping autoflush on :) but is there anything obvious I
> could try there?
> (server runs on linux openjdk 1.8.0_91, client runs in Tomcat on
> Windows Oracle JDK 1.8.0_121)
>
> Thanks,
> Colin 
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Exit a for-loop?

2017-02-27 Thread Dirk Kirsten
Hello Joseph,

to be honest, this doesn't sound particularly like functional
programming. The nice thing about functional programming is that you
shouldn't care about such optimization stuff (like breaking out of a for
loop), but instead our optimizer should be clever enough to stop
executing the function once he has enough results. So simply request the
first result and you should be fine. Something like this:


  (for $a at $pos in $seq1
  where $a = $seq2[$pos]
  return $a)[1]

Cheers

Dirk


On 02/27/2017 09:42 PM, Joseph wrote:
> Hi,
>
> I have two sets of numbers, and I would like to write a for-loop for
> comparison, so that I get only the first match between the numbers. I
> was thinking of a double for-loop, but I do not know how to exit the
> comparison as soon as I get the first match. Any idea? Thanks.
>
> Joseph 

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Somewhat unusual question

2017-02-24 Thread Dirk Kirsten
' about XQuery. It is a
>>>> query language.
>>>>
>>>> If you have to compare BaseX to something that most Java developers
>>>> will know, I'd use Hibernate and HQL, a library and DSL that is all
>>>> about querying data(bases).
>>>>
>>>> For C# developers, LINQ would probably ring a bell.
>>>>
>>>> Of course there is a lot more to it, and when it comes to web
>>>> applications, you can use it in almost every layer (templating,
>>>> routing, storage, etc).
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Max
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2017-02-22 13:43 GMT+01:00 Marco Lettere <m.lett...@gmail.com>:
>>>>> Hi to everyone,
>>>>>
>>>>> probably this is not the right place for such a discussion but the
>>>>> BaseX
>>>>> communitiy is the one I'm better introduced to and the one I trust
>>>>> the
>>>>> most.
>>>>> So I hope that this somewhat unusual excursus will anyway be of
>>>>> interest
>>>>> to
>>>>> some of you.
>>>>>
>>>>> As for myself I fell in love with XQuery and its power in terms of
>>>>> data
>>>>> manipulation many years ago. I wouldn't change it with anything
>>>>> else and
>>>>> BTW
>>>>> we're using it (thanks to the incredible BaseX runtime) much beyond
>>>>> data-processing being it the backbone of all our micro-service
>>>>> oriented
>>>>> architectures.
>>>>>
>>>>> Now, to the point, in the near future I probably will be called to
>>>>> face a
>>>>> somewhat skeptical customer who will argue about the technological
>>>>> choice
>>>>> of
>>>>> XQuery.
>>>>>
>>>>> My point will be to make a comparison with the technologies they're
>>>>> currently using and I would like to demonstrate that for a rather
>>>>> XML-
>>>>> (and
>>>>> in general data-) intensive workflow XQuery is perfectly suitable and
>>>>> probably better than many other alternatives.
>>>>>
>>>>> I would tend to exclude XSLT because it would face similar
>>>>> opposition. I
>>>>> would also exclude languages at a lower level of abstraction like
>>>>> Java,
>>>>> Python, Javascript, C/C++ and so on for obvious architectural
>>>>> reasons.
>>>>>
>>>>> But then only templating languages/engines come to my mind. Those
>>>>> would
>>>>> still be probably novel technologies to learn and wouldn't offer the
>>>>> structural, syntactic and semantic power of XQuery anyway.
>>>>>
>>>>> So I ask you kindly, in order to complete my preparation on these
>>>>> matters,
>>>>> is there anyone that has experience with other tools or languages
>>>>> that can
>>>>> be compared with XQuery when used for XML querying, generation,
>>>>> transformation, templating, composition and so on?
>>>>>
>>>>> Thanks a lot!
>>>>>
>>>>> Marco.
>>>>>
>>>>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Gzip/RESTXQ

2017-02-22 Thread Dirk Kirsten
Hello Kendall,

I have to go off-topic here for once, because it caught my eye and I
couldn't believe it: wordstar? Really? And I thought working with XML is
sometimes an ancient technology, but wordstar is... well, let's call it
well-established ;) Or are you working for George R.R. Martin (see
http://grrm.livejournal.com/197075.html), and if so how will Game Of
Thrones end? ;)

I am glad to see that XQuery is really a technology used for all kind of
data formats...

Cheers

Dirk


On 02/23/2017 04:52 AM, Kendall Shaw wrote:
> There is some point at which the time it takes to compress is worse in some 
> measure than serving uncompressed data.
>
> What I did was store precompressed data and serve that, instead of enabling 
> compression. So if that is an option you can use:
>
> web:response-header(map {'media-type': 'application/wordstar'}, map 
> {'Content-Encoding': 'gzip'})
>   ,  db:retrieve('test-binary', 'out.bin')
>
> where out.bin contains gzipped data.
>
> The web server might then serve the compressed data if Accept-Encoding 
> contains deflate or gzip
>
> Kendall
>
> On 2/21/17, 10:53 AM, "basex-talk-boun...@mailman.uni-konstanz.de on behalf 
> of Christian Grün" <basex-talk-boun...@mailman.uni-konstanz.de on behalf of 
> christian.gr...@gmail.com> wrote:
>
> Hi joseph,
> 
> > I am wondering whether for RESTXQ one should enable gzip encoding to 
> improve data transmission: if the database is used for storage (where the 
> data are in binary form), is the gzip option still useful?
> 
> Compression is always useful if you transfer data that can still be
> reduced in size. In other words, if you store JPG files, compression
> won’t help so much, but it will surely shrink JSON or WAV files.
> 
> Cheers,
> Christian
> 
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Somewhat unusual question

2017-02-22 Thread Dirk Kirsten
Hello Marco,

I don't really get why you want to exclude languages which you call
"lower level of abstraction", at least to me the architectural reasons
are not obvious at all. In the wild when I see XML handling applications
which are not XQuery/XSLT I would say they are mostly Java, C# or python
applications. All of them have XML handling capabilities, although I
think they are rather weak and limited if you know XQuery. Bu anyway,
certainly many people are using these languages for data handling in
general, so I think they are a valid choice.

Apart from that I think there is not so much to compare XQuery with.
Jsoniq comes to mind, because it is based on XQuery, but I think it is
probably dead and never got any traction.

And depending on the scale of the data processing you handle you might
want to consider a map/reduce approach, e.g. by using Hadoop and one of
the several languages specifically designed for it.

Just my thoughts. Hope it helps

Dirk


On 02/22/2017 04:13 PM, Marco Lettere wrote:
> Hi to everyone,
>
> probably this is not the right place for such a discussion but the
> BaseX communitiy is the one I'm better introduced to and the one I
> trust the most. So I hope that this somewhat unusual excursus will
> anyway be of interest to some of you.
>
> As for myself I fell in love with XQuery and its power in terms of
> data manipulation many years ago. I wouldn't change it with anything
> else and BTW we're using it (thanks to the incredible BaseX runtime)
> much beyond data-processing being it the backbone of all our
> micro-service oriented architectures.
>
> Now, to the point, in the near future I probably will be called to
> face a somewhat skeptical customer who will argue about the
> technological choice of XQuery.
>
> My point will be to make a comparison with the technologies they're
> currently using and I would like to demonstrate that for a rather XML-
> (and in general data-) intensive workflow XQuery is perfectly suitable
> and probably better than many other alternatives.
>
> I would tend to exclude XSLT because it would face similar opposition.
> I would also exclude languages at a lower level of abstraction like
> Java, Python, Javascript, C/C++ and so on for obvious architectural
> reasons.
>
> But then only templating languages/engines come to my mind. Those
> would still be probably novel technologies to learn and wouldn't offer
> the structural, syntactic and semantic power of XQuery anyway.
>
> So I ask you kindly, in order to complete my preparation on these
> matters, is there anyone that has experience with other tools or
> languages that can be compared with XQuery when used for XML querying,
> generation, transformation, templating, composition and so on?
>
> Thanks a lot!
>
> Marco.
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Gravierende Performance-Einbüße bei Persistierung von mehr als 5000, 160 KB große XML Datenstrukturen.

2017-01-10 Thread Dirk Kirsten
Hi Lucian,


sorry, I obviously forgot a very important word: "not". I would NOT
expect 100,000 documents to be added to be much of a problem. Sorry for
the confusion.


The log file is interesting, it certainly looks like the performance is
degrading. I can't say much about it, but I am sure Christian (our head
architect) will give you some pointers when he has time to answer.


However, given the description of your problem I would advise you to in
general rethink your architecture. So many consistent updates on a
database seem to me to be not very performant when done on only a single
database. So maybe you want to split up your data, e.g. you could put
all documents of a certain day into a separate database.

Or you could have one "up-to-date" database, which you always update and
transfer the entries within this database into another database during
low-performance times. The other database could have proper indexes and
whatever you need.

Because otherwise you will run into problems when querying your data. I
guess you don't want to just store your data, you want to do something
with it, don't you? Because just storing without using data seems a bit
useless... And for this you probably want to use some indexes and having
an up-to-date-index with constant updates is quite costly.

To sum it up: I think you want to split up your data in some way into
several databases.


However, I understand that you will still have something like 100,000
documents in a database (which should be fine), so your current
performance issue will still exist. My comment is more towards your
general architecture.


Cheers

Dirk


On 01/10/2017 08:24 PM, Bularca, Lucian wrote:

> Hi Dirk,
>
>  thanks for your fast reply :)
>
> Regarding the performance measure, I've forgot to mention, that I've
> based my affirmations on the protocol entries from the BaseX log file
> (see attached basex.log). The intention of the System.out made in each
> iteration, is just to protocol the order number of the added xml
> structure, not the duration of a persist operation. This System.out
> indeed does have an impact on the overall performance, but cannot
> explain the monotonic increase of the insert operations duration (see
> attached basex.log file). After 24 hours of inserting xml
> test-structures, only the half of the 100.000 xml test-structures
> where added in the database, at a rate of at most 1 structure / 2 seconds.
>
> All these tests where made against the 8.5.3 version of the BaseX
> database.
>
> In production, we expect peaks of 2,7 * 10 ^ 5 xml structures to
> persist / 24 hours (~ 31 xml structures / 1 second). Do you mean with
> "However, I would expect 100,000 documents added to be much of a
> problem.", that persisting 100.000 xml structures in the BaseX
> database is problematic?
>
>
> Regards,
> Lucian
> 
> *Von:* basex-talk-boun...@mailman.uni-konstanz.de
> [basex-talk-boun...@mailman.uni-konstanz.de]" im Auftrag von "Dirk
> Kirsten [d...@basex.org]
> *Gesendet:* Dienstag, 10. Januar 2017 12:52
> *An:* basex-talk@mailman.uni-konstanz.de
> *Betreff:* Re: [basex-talk] Gravierende Performance-Einbüße bei
> Persistierung von mehr als 5000, 160 KB große XML Datenstrukturen.
>
> Hello Lucian,
>
>
> please be aware that this is an English-speaking mailing list as we
> have many users from all over the world and the mailing list is
> intended to help everyone. But as most of our team members are German
> (well, and Bavarians...) we of course understand it. Hence, I answer
> in English (for all other: Lucian seem to have same performance issues
> when adding many documents).
>
>
> First of all, are you sure your tests sufficiently test the add
> performance. Looking at your file TestBaseXClient.java it seems to not
> record the runtimes of the individual insertions, but just the overall
> runtime of in this case 10 insertions.
>
> Also, at least in the Example you provided you also do some other
> stuff (especiall printing to sysout), which obviously also has a
> performance impact.
>
>
> Optimizing or creating indexes in between a mass update should not
> increase the speed, as it builds the indexes, which will be
> invalidated after the next index, so I would not expect any speed up here.
>
>
> What version of BaseX did you use?
>
>
> Did you set AUTOFLUSH (see
> http://docs.basex.org/wiki/Options#AUTOFLUSH) to false? This should
> benefit performance.
>
>
> In general it is also a good architectural approach to split up
> documents into many databases instead of having one large database.
> Given that you can access as many databases as you want in one query
> you will not lose any qu

Re: [basex-talk] Gravierende Performance-Einbüße bei Persistierung von mehr als 5000, 160 KB große XML Datenstrukturen.

2017-01-10 Thread Dirk Kirsten
Hello Lucian,


please be aware that this is an English-speaking mailing list as we have
many users from all over the world and the mailing list is intended to
help everyone. But as most of our team members are German (well, and
Bavarians...) we of course understand it. Hence, I answer in English
(for all other: Lucian seem to have same performance issues when adding
many documents).


First of all, are you sure your tests sufficiently test the add
performance. Looking at your file TestBaseXClient.java it seems to not
record the runtimes of the individual insertions, but just the overall
runtime of in this case 10 insertions.

Also, at least in the Example you provided you also do some other stuff
(especiall printing to sysout), which obviously also has a performance
impact.


Optimizing or creating indexes in between a mass update should not
increase the speed, as it builds the indexes, which will be invalidated
after the next index, so I would not expect any speed up here.


What version of BaseX did you use?


Did you set AUTOFLUSH (see http://docs.basex.org/wiki/Options#AUTOFLUSH)
to false? This should benefit performance.


In general it is also a good architectural approach to split up
documents into many databases instead of having one large database.
Given that you can access as many databases as you want in one query you
will not lose any query capabilities and at some point you might
encounter certain limits. However, I would expect 100,000 documents
added to be much of a problem.


As a side node, as it seems you are evaluating BaseX and I guess you are
doing this for a reason, it might be faster/easier when talking to our
BaseX members, who of course can help you with evaluating your problem
and identifying whether BaseX is the right choice for your given
problem. Take a look at http://basexgmbh.de/ for our commercial offerings.


Cheers

Dirk


On 01/10/2017 05:44 PM, Bularca, Lucian wrote:
> Guten Tag,
>
>  im Rahmen einer Performance-Evaluierung der Persistierung von XML
> Datenstrukturen in einer BaseX Datenbank, haben wir stetig absinkende
> Persistierungs-Raten umgekehrt proportional zu der Datenbank-Größe
> festgestellt.
>
> Dieses Verhalten ist erklährbar und wäre auch einnehmbar, wenn nicht
> die Dauer der Persistierung einer ~ 160 KB großen XML Datenstruktur,
> von Anfang ~ 10 ms auf  ~ 2500 ms kommne würde, nach ~ 50.000
> Persistierungs-Vorgänge.
>
> Dabei versuchen wir 100.000 unterschiedliche, ungefähr 160 KB große
> XML Datenstrukturen mittels der Java API in eine BaseX Datenbank zu
> speichern um dabei die Gesammt-Dauer bzw. die Dauer der einzelnen
> Persistierungs-Vorgänge zu messen. Die BaseX Datenbank wurde im HTTP
> Modus (basexhttp) mit -Xmx 4048m gestartert.
>
> Die oben genannte Messwerte blieben gleich, unabhängig davon, ob alle
> XM Datenstrukturen in eine einzige Session gespeichert wurden, oder
> wenn alle 500 Persistierungs-Vorgänge der Socket (DB-Anbindung)
> geschlossen und erneut geöffnet wurde. Eine Indizierung der Datenbank
> (mittels der GUI "Optimize All", bzw. "Create Text Index")
> zwischendurch konnte die Persistierungs-Raten nicht beeinflussen bzw.
> optimieren.
>
> Ein Beispiel der Test-Klassen (nur exemplarisch, nicht kompilierbar !)
> die wir dazu benutzt haben, sind im  Anhang BaseXClient.java.zip zu
> dieser E-Mail zu finden.
>
> Sind generell, Persistierungs-Raten von mehr als 160 KB / 2500 ms bei
> mehr als 30.000 vorhandene Einträge in der BaseX zu erwarten, oder
> können wir diese Persistierungs-Zeiten drastisch optimieren (und wenn
> ja, wie)?
>
>
> Mit freundlichen Grüßen,
> Lucian Bularca
>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] xquery for position

2016-12-01 Thread Dirk Kirsten
Hi George,

you can't disable parts of the optimizer. I guess to be really able to
help you we will need to see the relevant part of the query and best an
SSCCE.

However, if the problem exists in Saxon and BaseX it is quite probably a
problem with your query instead of the optimizers fault. I would be
rather surprised to see that Saxon and BaseX have exactly the same bug.

Cheers
Dirk

On 12/01/2016 03:15 PM, George Sofianos wrote:
> Hi,
>
> I'm having some issues with finding the position of a value in a for
> loop. My query is complex so I can't write it in an example here (at
> least for the moment). I think the XQuery optimizer messes up with it.
>
> The result I get from the for loop is something like this for every
> return entry:
>
> 2113 - 11953 - 8760
>
> where 2113 is the stuck $pos, 11953 is the count $count, and 8760 is
> the number of values in the sequence I'm looping on.
>
> Any Ideas? Can I disable part of the optimizer and see if that is the
> problem ?
>
> p.s1 I'm already using declare option db:inlinelimit '0'; because I've
> noticed some time ago it helps with compiling the XQuery files
> (without this, I have cases of very slow or freezing compilations).
>
> p.s2 I've also had issues this with Saxon involving $pos.
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Cannot insert node into empty db/collection

2016-10-06 Thread Dirk Kirsten
Hello Erdal,

an XML document has to have at least one (root) element, otherwise it
isn't a well-formed XML document. This is specified by the W3C, see
https://www.w3.org/TR/2008/REC-xml-20081126/#sec-well-formed: " A
textual object is a *well-formed* XML document if [...] it contains one
or more elements.". So, nothing we can do about this :)

But you can create a simple document with a lonely root node to later
put content into. E.g. you could execute the following query:

  db:add("test", , "doc.xml")

which creates the well-formed XML document doc.xml with the root element
 in your test database.


Hope this helps

Dirk


On 10/06/2016 07:19 PM, Erdal Karaca wrote:
> Hi Dirk,
> Thanks for the answer!
> When creating the database, I do not know what the root of the
> document to create will be.
> Also, I do not have any physical documents (xml files) to add
> initially as the root elements will be created programmatically (basex
> embedded mode).
> the db:add() command needs an initial input: Is there a way to create
> an empty document?
>
> Thanks.
>
> 2016-10-06 18:29 GMT+02:00 Dirk Kirsten <d...@basex.org
> <mailto:d...@basex.org>>:
>
> Hello Erdal,
>
> a database consists of (multiple) documents. When you create a
> database
> with the given command it will be en empty database without any
> document. So to write into it you will have to add at least one
> document
> first, e.g. by using the ADD command
> (http://docs.basex.org/wiki/Commands#ADD
> <http://docs.basex.org/wiki/Commands#ADD>) or db:add()
> (http://docs.basex.org/wiki/Database_Module#db:add
> <http://docs.basex.org/wiki/Database_Module#db:add>)
>
> Cheers
> Dirk
>
> On 10/06/2016 06:03 PM, Erdal Karaca wrote:
> > Hi,
> > When creating an empty database, then trying to insert a node
> into its
> > root, I get the following error message:
> >
> > Command:
> > create db test
> >
> > XQuery:
> > insert node  into /
> >
> > Error:
> > [XUDY0027] Insert target is an empty sequence.
> >
> > How can I populate an empty database? - I am using basex 8.5.3.
> >
> > Thanks!
>
> --
> Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 91 68 276 <tel:0049%207531%2091%2068%20276>,
> Fax: 0049 7531 20 05 22 <tel:0049%207531%2020%2005%2022>
>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Cannot insert node into empty db/collection

2016-10-06 Thread Dirk Kirsten
Hello Erdal,

a database consists of (multiple) documents. When you create a database
with the given command it will be en empty database without any
document. So to write into it you will have to add at least one document
first, e.g. by using the ADD command
(http://docs.basex.org/wiki/Commands#ADD) or db:add()
(http://docs.basex.org/wiki/Database_Module#db:add)

Cheers
Dirk

On 10/06/2016 06:03 PM, Erdal Karaca wrote:
> Hi,
> When creating an empty database, then trying to insert a node into its
> root, I get the following error message:
>
> Command:
> create db test
>
> XQuery:
> insert node  into /
>
> Error:
> [XUDY0027] Insert target is an empty sequence.
>
> How can I populate an empty database? - I am using basex 8.5.3.
>
> Thanks!

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Upgrade from 7.9 to 8.3

2016-09-07 Thread Dirk Kirsten
Hi Bram,

with BaseX 8 we changed the client/server protocol. So you will need do
update to a compatible PHP client version. Fortunately, there is a PHP
client compatible with BaseX 8 onwards:
https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/php

Cheers, Dirk


On 09/07/2016 10:29 AM, Bram Vanroy wrote:
>
> Hi everyone
>
>  
>
> We’re in a bit of a pickle. We upgraded to BaseX 8.3 after some hard
> drives failed, but now the PHP Basex client can’t connect to the
> server any more.
>
>  
>
> Here is the general idea:
>
>  
>
> -  basexserver is launched from server A, but the .basex
> configuration file it uses is stored on server B. This is the
> unchanged file we used in BaseX 7.9;
>
> -  the data that the .basex file refers to is on server C,
> this has not changed either since the hard drive crash;
>
> -  the PHP basex client is on server D, this file has not been
> changed either.
>
>  
>
> So I am guessing that either we need to update one of our files, OR
> we’d need to re-import our data into the new BaseX server. Do you have
> any idea how to handle this?
>
>  
>
>  
>
> Kind regards
>
>  
>
> Bram
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] REST API not working

2016-09-01 Thread Dirk Kirsten
Hello,

How do you start the basex server? Could you please start it in debug
mode and post us the console output?

Cheers, Dirk

On 08/31/2016 04:41 PM, E. Wray Johnson wrote:
> I apologize, by 12 I meant Windows Server 2012.
> BaseX version is 8.5.3
> By TCP vs REST I mean for REST I was using default port 8984 instead
> of the default server TCP port1984
> For example: http:///admin/:/admin/@localhost:8984//rest  /OR
> http://localhost:8984//rest
> /
> I run basexserver from DOS Command Prompt/.
> /
> I am using a web browser to test as I have many times before with
> version 8.4
> I know the server is listening because it hangs and does not return,
> which does not occur when the server is stopped./
> /
>
> On Wed, Aug 31, 2016 at 9:15 AM, Dirk Kirsten <d...@basex.org
> <mailto:d...@basex.org>> wrote:
>
> Hello,
>
> Windows 12? I am an long-time linux-only user, but isn't the most
> current windows version 10 or am I missing the news completely?
>
> You will have to be much more specific. Please specify which BaseX
> version you use, please post how you start the basexserver and the
> console output and how you try to reach the REST endpoint. Also, I
> don't
> know what you mean by you are not confusing TCP and REST port. This
> statement doesn't really make sense, as REST uses TCP...
>
> Cheers
>
> Dirk
>
>
> On 08/31/2016 02:09 PM, E. Wray Johnson wrote:
> > Windows 12 server, running basexserver. Server is listening but
> hangs and never returns anything. When server is killed behavior
> is different so I can tell the server was listening on the REST
> port when running.  I am not confusing the TCP port with REST port.
>
> --
> Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
>     |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22
>
>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] REST API not working

2016-08-31 Thread Dirk Kirsten
well, that makes sense :)


On 08/31/2016 03:17 PM, Bram Vanroy wrote:
> Just a guess, but I think he means Windows Server 2012!
>
> -Oorspronkelijk bericht-
> Van: basex-talk-boun...@mailman.uni-konstanz.de
> [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Namens Dirk Kirsten
> Verzonden: woensdag 31 augustus 2016 15:15
> Aan: basex-talk@mailman.uni-konstanz.de
> Onderwerp: Re: [basex-talk] REST API not working
>
> Hello,
>
> Windows 12? I am an long-time linux-only user, but isn't the most current
> windows version 10 or am I missing the news completely?
>
> You will have to be much more specific. Please specify which BaseX version
> you use, please post how you start the basexserver and the console output
> and how you try to reach the REST endpoint. Also, I don't know what you mean
> by you are not confusing TCP and REST port. This statement doesn't really
> make sense, as REST uses TCP...
>
> Cheers
>
> Dirk
>
>
> On 08/31/2016 02:09 PM, E. Wray Johnson wrote:
>> Windows 12 server, running basexserver. Server is listening but hangs and
> never returns anything. When server is killed behavior is different so I can
> tell the server was listening on the REST port when running.  I am not
> confusing the TCP port with REST port.
>
> --
> Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> `-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22
>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] REST API not working

2016-08-31 Thread Dirk Kirsten
Hello,

Windows 12? I am an long-time linux-only user, but isn't the most
current windows version 10 or am I missing the news completely?

You will have to be much more specific. Please specify which BaseX
version you use, please post how you start the basexserver and the
console output and how you try to reach the REST endpoint. Also, I don't
know what you mean by you are not confusing TCP and REST port. This
statement doesn't really make sense, as REST uses TCP...

Cheers

Dirk


On 08/31/2016 02:09 PM, E. Wray Johnson wrote:
> Windows 12 server, running basexserver. Server is listening but hangs and 
> never returns anything. When server is killed behavior is different so I can 
> tell the server was listening on the REST port when running.  I am not 
> confusing the TCP port with REST port.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Basex server ports

2016-08-31 Thread Dirk Kirsten
Hi Bram,

well, all of them. Only one application at a given time can listen to a
single (TCP-)port, sou otherwise you will get an "address already in
use" error.

Cheers, Dirk


On 08/31/2016 12:35 PM, Bram Vanroy wrote:
>
> Hi all
>
>  
>
> I am trying to initialise multiple server on a single machine. This
> will probably be possibly by listening to different ports. The
> question that I have is that I am not sure which values to change in
> the .basex file. Candidates are:
>
>  
>
> PORT
>
> SERVERPORT
>
> EVENTPORT
>
> STOPPORT
>
>  
>
> Which of these cannot be the same when running a BaseX server on the
> same machine?
>
>  
>
>  
>
> Thank you in advance
>
>  
>
> Bram Vanroy
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Using the same database in many BaseX instances

2016-08-24 Thread Dirk Kirsten
Hello Christophe,

this very much looks like a bug to me. Certainly, we should catch an NPE
in any case. A brief look at the code shows this is during closing, so I
guess it is a concurrency issue. I would guess that the number of
instances isn't even relevant, but instead that you moved to another
machine which might simply behave differently because it is faster or
the scheduler might behave a big differently, etc. pp.

Answering your specific questions:

1) It is legal. We are not going to sue you ;) No, it should (in theory)
be fine

2) No, not at the moment. At least i am not aware of it

3) Yes, maybe you can try that. As said before, i guess the behaviour
change is caused be the different computer, not the number of instances
(but of course it might also increase the likelihood of a race condition
if there are more parallel instances)

4) I don't think so. I guess you will have to wait until Christian is
back from his vacation and tries to fix the bug.

Cheers

Dirk


On 08/24/2016 03:06 PM, cmarch...@oxiane.com wrote:
> Hello,
>
> as discussed here few monthes ago, I do this :
> Install many instances (8) of BaseX on the same computer
> Start one instance, here called "main-instance"
> Create a database "library" , and load a filesystem directory into
> "library"
> Stop main-instance
> For each "other-instance", create a sym-link to main-instance/data/library
> Start "other-instances"
>
> On each instance, create 2 new databases "input" and "output", load a
> file in "input", process it and store result in "output". The process
> queries a lot "library", but never modifies "library". Then export
> "output" and drop databases "input" and "output". I have about 100
> files to process; and I distribute them on the various instances
>
> I had a first test environment, with only 4 isntances, and everything
> was working perfectly.
> Now, I'm working on target environment, a bigger computer with 8
> instances. Process fails, at least one time per instance, so between 8
> and 12 times on 100 process. The exception is
> java.lang.NullPointerException
> at org.basex.data.DiskData.write(DiskData.java:136)
> at org.basex.data.DiskData.close(DiskData.java:151)
> at org.basex.core.Datas.unpin(Datas.java:54)
> at org.basex.core.cmd.Close.close(Close.java:45)
> at org.basex.query.QueryResources.close(QueryResources.java:110)
> at org.basex.query.QueryContext.close(QueryContext.java:596)
> at org.basex.query.QueryProcessor.close(QueryProcessor.java:251)
> at org.basex.core.cmd.AQuery.query(AQuery.java:124)
> at org.basex.core.cmd.XQuery.run(XQuery.java:22)
> at org.basex.core.Command.run(Command.java:398)
> at org.basex.core.Command.execute(Command.java:100)
> at org.basex.server.ClientListener.run(ClientListener.java:136)
>
> If I change the sym-links by a true copy (cp -r main/data/library
> other/data/), it now works correctly, but the copy takes a long time
> (database is about 30gb), and it consumes disk space.
> The computer I use has many available cores, and many RAM to use, so
> I'd love to add other instance, many 16 more to reach 24 isntances,
> but if database grow, I'm going to have disk-space troubles...
>  
> 1 - is it legal to share a database (and files) between many instances
> as far as database is access read-only ?
> 2 - is there a way to configure a database to be read-only ?
> 3 - why symbolic links were perfectly usable with 4 instances, and do
> not with 8 instances ?  (Hum I have to try symlinks with only 4
> instances on the new computer...)
> 4 - are there other specific things to check to do what I need ?
>  
> Best regards,
> Christophe

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] JBoss 6.4 and BaseX 8.4

2016-07-22 Thread Dirk Kirsten
Hello Carl,

are your sure you are using the same client in Eclipse as in JBoss? I
don't know JBoss, but it surely has a location where to put external
library files, so BaseX should be located there. Please make absolutely
sure you are using the correct jar file in JBoss.

With BaseX 8 we changed the authentication schema for clients to improve
security. You can see the changes by using the history function in our
wiki:
http://docs.basex.org/index.php?title=Server_Protocol=historysubmit=12308=11136

Cheers, Dirk


On 07/22/2016 01:30 PM, Bondeson, Carl wrote:
>
> The client works in a test suite in Eclipse.  What actually changed?
> Why would it work in Eclipse and not in JBoss?
>
>  
>
> Thanks for the quick response.
>
>  
>
> Carl R Bondeson
>
> IT Analyst 3
>
> Information Technology
>
> Connecticut Department of Public Health
>
> 410 Capitol Ave
>
> Hartford, CT 06134
>
> Phone: 860-509-7434
>
> carl.bonde...@ct.gov <mailto:carl.bonde...@ct.gov>
>
> logosmall
>
>  
>
> *From:*basex-talk-boun...@mailman.uni-konstanz.de
> [mailto:basex-talk-boun...@mailman.uni-konstanz.de] *On Behalf Of
> *Dirk Kirsten
> *Sent:* Friday, July 22, 2016 7:10 AM
> *To:* basex-talk@mailman.uni-konstanz.de
> *Subject:* Re: [basex-talk] JBoss 6.4 and BaseX 8.4
>
>  
>
> Hello Carl,
>
> did you see the mail by Christian Grün on the 20th? You will need to
> update the client as well, as with the major version 8 we changed the
> client/server protocol.
>
> I doubt it has anything to do with JBoss specifically.
>
> Cheers
> Dirk
>
> On 07/22/2016 12:38 PM, Bondeson, Carl wrote:
>
> We just upgraded from 7.8 to 8.5. We are using BaseX in a JBoss
> multi-threaded application. Something has changed with
> ClientSession. I have log4j at trace level and the server is
> started but when a call is made to the ClientSession constructor
> nothing happens.
>
>  
>
>  
>
> static final int BASEX_SERVER_PORT = 1990;
>
> static final String BASEX_USER = "admin";
>
> static final String BASEX_PASSWORD = "admin";
>
> static final String BASEX_HOST = "localhost";
>
>  
>
> try {
>
>  
>
> // get server status
>
> boolean
> serverstarted = BaseXServer.ping(BASEX_HOST, BASEX_SERVER_PORT);
>
> // server started?
>
> if (!serverstarted) {
>
>
> instance.basexlog.trace("BaseXDictionary: BaseX: Start BaseX server");
>
> //
> no-> create a new instance using server and client ports
>
> //
> BaseXServer server =new BaseXServer("-p" +
> BASEX_SERVER_PORT);
>
>  
>
> } else {
>
> //
> yes-> log the event
>
>
> instance.basexlog.trace("BaseXDictionary: BaseX: BaseX server
> already started");
>
>  
>
> }
>
>  
>
> // start
> initialization process
>
>
> instance.basexlog.debug("BaseXDictionary: BaseX: Server started");
>
>  
>
> // this call never
> returns or something strange is going on
>
>
> instance.mapperDBSession = new
> ClientSession(BaseXDictionary.BASEX_HOST,
> BaseXDictionary.BASEX_SERVER_PORT,
>
>   
>  
> BaseXDictionary.BASEX_USER, BaseXDictionary.BASEX_PASSWORD);
>
>  
>
>  
>
> This next log4j output is never seen in the log file
>
>  
>
>        
> instance.basexlog.trace("BaseXDictionary: BaseX: Client Session
> created ");
>
>  
>
>  
>
> Any JBoss users?
>
>

Re: [basex-talk] JBoss 6.4 and BaseX 8.4

2016-07-22 Thread Dirk Kirsten
Hello Carl,

did you see the mail by Christian Grün on the 20th? You will need to
update the client as well, as with the major version 8 we changed the
client/server protocol.

I doubt it has anything to do with JBoss specifically.

Cheers
Dirk

On 07/22/2016 12:38 PM, Bondeson, Carl wrote:
>
> We just upgraded from 7.8 to 8.5. We are using BaseX in a JBoss
> multi-threaded application. Something has changed with ClientSession.
> I have log4j at trace level and the server is started but when a call
> is made to the ClientSession constructor nothing happens.
>
>  
>
>  
>
> static final int BASEX_SERVER_PORT = 1990;
>
> static final String BASEX_USER = "admin";
>
> static final String BASEX_PASSWORD = "admin";
>
> static final String BASEX_HOST = "localhost";
>
>  
>
> try {
>
>  
>
> // get server status
>
> boolean serverstarted
> = BaseXServer.ping(BASEX_HOST, BASEX_SERVER_PORT);
>
> // server started?
>
> if (!serverstarted) {
>
>
> instance.basexlog.trace("BaseXDictionary: BaseX: Start BaseX server");
>
> //
> no-> create a new instance using server and client ports
>
> //
> BaseXServer server =new BaseXServer("-p" +
> BASEX_SERVER_PORT);
>
>  
>
> } else {
>
> //
> yes-> log the event
>
>
> instance.basexlog.trace("BaseXDictionary: BaseX: BaseX server already
> started");
>
>  
>
> }
>
>  
>
> // start
> initialization process
>
>
> instance.basexlog.debug("BaseXDictionary: BaseX: Server started");
>
>  
>
> // this call never
> returns or something strange is going on
>
>
> instance.mapperDBSession = new
> ClientSession(BaseXDictionary.BASEX_HOST,
> BaseXDictionary.BASEX_SERVER_PORT,
>
>   
>  
> BaseXDictionary.BASEX_USER, BaseXDictionary.BASEX_PASSWORD);
>
>  
>
>  
>
> This next log4j output is never seen in the log file
>
>  
>
>
> instance.basexlog.trace("BaseXDictionary: BaseX: Client Session
> created ");
>
>  
>
>  
>
> Any JBoss users?
>
>  
>
> Thanks
>
>  
>
>  
>
> Carl R Bondeson
>
> IT Analyst 3
>
> Information Technology
>
> Connecticut Department of Public Health
>
> 410 Capitol Ave
>
> Hartford, CT 06134
>
> Phone: 860-509-7434
>
> carl.bonde...@ct.gov <mailto:carl.bonde...@ct.gov>
>
> logosmall
>
>  
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Behaviour of db:open('mydb') update {} in updating functions

2016-07-22 Thread Dirk Kirsten
Hi Max,

I just copied it in my BaseX instance and it (imho correctly) returned
the error message "Copy expression is incomplete" as "update {}" is
invalid (if you want to update nothing it should be an empty sequence).

However, given this works I would not be surprised if this does not
update the database. As you probably know "update" is just a more
convenient way of using the copy/modify/transform espression. However,
this will not update the original element, but instead create a copy and
update this.

So I would expect your variable $_:PUB to hold a main memory copy of the
database and this variable will be modified, i.e. your original database
will remain the same.

Hope this helps, Dirk


On 07/22/2016 12:17 PM, Maximilian Gärber wrote:
> Hi,
>
> I just noticed that when I use a db that is opened this way, I cannot
> do updates anymore.
>
> Example:
> declare variable $_:PUB := db:open('PUB') update {};
>
> Then, inside updating function:
>
> let $sec := $_:PUB//Section[@Guid = $id]
> return replace node trace($sec) with changed
>
> There is no error whatsoever, the update simply doesnt happen. (BaseX 8.4.4)
>
> Bug?
>
> Regards,
> Max

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Off topic: on leave

2016-07-13 Thread Dirk Kirsten
Hi Bram,

Just as a general note for everyone: This should not be a problem. We do
use Mailman as mailing list handler and it automatically detects
auto-reply mails and disregards to send them to the list.

So: Please enjoy your vacation and don't worry about the mailing list :-)

Cheers, Dirk


On 07/13/2016 11:11 AM, Bram Vanroy | KU Leuven wrote:
>
> Hello everyone
>
>  
>
> I will be leaving on vacation soon, from 13th til 25th of July. I set
> an automated reply for my email account, but I’m not sure if it is
> smart enough to detect mailing lists. So if the programme is not smart
> enough, and you keep getting automated replies, feel free to manually
> unsubscribe me. I haven’t done that myself, because I’d like to read
> the list when I get back.
>
>  
>
>  
>
> Good bye!
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Who uses XQuery update? Dedicated wiki page for index updates?

2016-07-12 Thread Dirk Kirsten
Hi Max,

I totally agree. By chance I also yesterday run into some issues with
Indexes and found the current documentation especially about index
configuration not very exhaustive. Especially from the point of view of
inexperienced BaseX users I find it rather inconvenient trying to figure
out how to properly create and maintain indexes.

Best regards from the other side of the lake, Dirk

On 07/12/2016 04:33 PM, Maximilian Gärber wrote:
> Hi,
>
> I will  try to add the infos I found most helpful but I am sure it
> will not be exhaustive...
>
> Regards,
>
> Max
>
> 2016-07-12 9:36 GMT+02:00 Christian Grün <christian.gr...@gmail.com>:
>> Hi Max,
>>
>> Good Idea. I think it would fit into the "Advanced User's Guide".
>> Personally, I would keep XQuery Update in the XQuery section, but
>> "Indexes" (c|sh)ould surely be moved. And "Index Configuration" still
>> needs to be written. Does it mean that you’d be interested in writing
>> such an article? :)
>>
>> Cheers
>> Christian
>>
>>
>>> I was just thinking there could be other users that stumble over the
>>> details of index updates and optimization.
>>>
>>> Maybe this deserves a top-level page in the wiki? Then we would have:
>>>
>>> * Indexes: Explains about what is there
>>> * XQuery Update: How to use
>>> * Index Configuration: How to configure and good practice
>>>
>>> Regards,
>>>
>>> Max

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Tagsoup on Web app

2016-06-24 Thread Dirk Kirsten
Hi Kristian,

excellent idea! I would very much support this, especially as I use
Fedora as well :)
However, packaging is quite different for different distributions,
that's one of the reasons why we can't update BaseX in all distros
reliably. However, recently there has been some effort to unify
application distribution, I personally think flatpak
(http://flatpak.org) is the most promising.
If you want to contribute and srtart exploring flatpak and try to build
a BaseX flatpak app it would be more than welcome. If we would have that
users from most major distributions (flatpak currently supports debian,
ubuntu, fedora, arch and gentoo) would finally be able to use proper
package management.

Cheers
Dirk

On 06/24/2016 09:43 AM, Kristian Kankainen wrote:
>
> Hi
>
> Nearly related. I sometimes think of wanting to learn to package
> software for Fedora. Who should I talk with about a responsibility
> like this?
>
> I guess the workflow would be quite the same for Ubuntu and other
> Linuxes, so probably it could be automated to quite an extent within
> the user community?
>
> Best regards
> Kristian K
>
>
> 23.06.2016 19:55 Ben Mitchell kirjutas:
>>
>> Hi,
>>
>>  
>>
>> Do you know if there is a simple way to install the tagsoup parser in
>> the basex web app servlet - If so, is there an instruction set?
>>
>> Also, are there any plans to update the Ubuntu repositories with the
>> latest versions?
>>
>>  
>>
>> Many thanks
>>
>> Ben
>>
>>  
>>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] multiple inserts/update/deletes in single transaction

2016-05-20 Thread Dirk Kirsten
Hello Kristian,

thanks for the pointer! The documentation is certainly misleading, I
agree. However, it is not wrong and I think the issue here is that RUN
can be used for two completely separate things: run an xquery file
(where it is indeed a single transaction, so the comment is appropriate)
and run a basex command script.

I personally would remove the second functionality (run a basex command
script) from the RUN command and instead include the functionality in
the already existing EXECUTE function. That way it would be clear: Use
RUN for xquery files, use EXECUTE for bxs.

I will discuss this with Christian Grün when he's back.

Cheers
Dirk

On 05/20/2016 09:41 AM, Kristian Kankainen wrote:
> Maybe it would be wise to change the documentation or specify what
> exactly is meant by the phrase "This command can be used to run
> several commands in a single transaction". Clearly it can be
> understood in a wrong way.
>
> Cheers
> Kristian
>
> 20.05.2016 09:59 Dirk Kirsten kirjutas:
>>
>> Hello Genneva,
>>
>> this is expected behaviour. BaseX script executed each command
>> separately. This is by design and required by the nature of XQuery
>> (Update), which by design always executes as one transaction - Which
>> can be difficult do deal with if you have a large amount of data and
>> have to e.g. hold it in memory.
>>
>> Each XQuery runs in one single transaction, so you can simply add
>> your documents via XQuery, e.g.
>>
>> db:add("DB", "embedded7.xml"),
>> db:add("DB", "embedded8.xml")
>>
>> Cheers
>>
>> Dirk
>>
>>
>> On 05/19/2016 08:11 PM, Wang, Genneva wrote:
>>> Hi 
>>>
>>> I’m trying to figure out whether batched transaction would work for
>>> basex, and I came across the RUN and EXECUTE command specified
>>> in http://files.basex.org/releases/8.4/BaseX84.pdf page 58-59.  The
>>> document mentioned following in the summary section:
>>>
>>> RUN:Evaluates the contents of file as XQuery expression. If the file
>>> ends with the suffix .bxs, the file content will be evaluated as
>>> command script. This command can be used to run several commands in
>>> a single transaction
>>> EXECUTE: Evaluates the specified input as command script. This
>>> command can be used to run several commands in a single transaction.
>>>
>>> I’ve tried this myself
>>> For example, I’d like to know if I batch 2 inserts, if one fails,
>>> would both inserts get rollback. 
>>>
>>> I’m using a simple .bxs (attached and also listed below for your
>>> convenience) and run the execute using GUI. 
>>>
>>> OPEN test
>>> ADD TO embedded7.xml embedded
>>> ADD TO embedded8.xml embedded
>>> CLOSE
>>>
>>> The second ADD (embedded8.xml) is  not a valid xml format so I’m
>>> expecting it to fail, and rollback both files if any of them have
>>> already added. But after executing this script, I’m seeing
>>> embedded7.xml have been added. 
>>>
>>> Would you be able to confirm if this is the expected behavior ? If
>>> so,  is there anyway that I can batch multiple inserts and ensures
>>> that these batch of files can be committed at the same time, and
>>> rollback  all together if any of the file has an error ?
>>>
>>> Thank you very much for your help. 
>>
>> -- 
>> Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
>> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
>> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
>> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
>> `-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Stopping the http server

2016-05-20 Thread Dirk Kirsten
Hello France,

good that you ping, bit I actually have the same problem about being a
programmer and not a sysadmin :) So take everything I say with a grain
of salt. So you start up your jetty as outline in the Jetty documentation:

java -jar jetty-runner.jar --stop-port 8181 --stop-key abc123> java -jar 
jetty-runner.jar --stop-port 8181 --stop-key abc123

and there you can give it any stop keys you want. Within the library path of 
Jetty you put your BaseX.jar and that way you will be able to use XQuery/RESTXQ.
When you download e.g. our zip distribution it is already bundled the other way 
round, i.e. jetty is included in the library path of BaseX and we start Jetty 
automatically.

I hope that clears up things a little and best regards
Dirk


On 05/18/2016 11:31 PM, France Baril wrote:
> I'm pinging you again with my question in case it slipped through the
> cracks...
>
> On Thu, May 12, 2016 at 6:19 PM, France Baril
> <france.ba...@architextus.com <mailto:france.ba...@architextus.com>>
> wrote:
>
> I'm not sure I understand how to do that. If the call to baseX.jar
> start has everything embedded together, how would I split it up to
> control each part?
>
> I'm a programmer, not a sysadmin, so it might be a basic question,
> but I'm not finding anything in the doc.
>
>
>
>
> -- 
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com <mailto:france.ba...@architextus.com>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] multiple inserts/update/deletes in single transaction

2016-05-20 Thread Dirk Kirsten
Hello Genneva,

this is expected behaviour. BaseX script executed each command
separately. This is by design and required by the nature of XQuery
(Update), which by design always executes as one transaction - Which can
be difficult do deal with if you have a large amount of data and have to
e.g. hold it in memory.

Each XQuery runs in one single transaction, so you can simply add your
documents via XQuery, e.g.

db:add("DB", "embedded7.xml"),
db:add("DB", "embedded8.xml")

Cheers

Dirk


On 05/19/2016 08:11 PM, Wang, Genneva wrote:
> Hi 
>
> I’m trying to figure out whether batched transaction would work for
> basex, and I came across the RUN and EXECUTE command specified
> in http://files.basex.org/releases/8.4/BaseX84.pdf page 58-59.  The
> document mentioned following in the summary section:
>
> RUN:Evaluates the contents of file as XQuery expression. If the file
> ends with the suffix .bxs, the file content will be evaluated as
> command script. This command can be used to run several commands in a
> single transaction
> EXECUTE: Evaluates the specified input as command script. This command
> can be used to run several commands in a single transaction.
>
> I’ve tried this myself
> For example, I’d like to know if I batch 2 inserts, if one fails,
> would both inserts get rollback. 
>
> I’m using a simple .bxs (attached and also listed below for your
> convenience) and run the execute using GUI. 
>
> OPEN test
> ADD TO embedded7.xml embedded
> ADD TO embedded8.xml embedded
> CLOSE
>
> The second ADD (embedded8.xml) is  not a valid xml format so I’m
> expecting it to fail, and rollback both files if any of them have
> already added. But after executing this script, I’m seeing
> embedded7.xml have been added. 
>
> Would you be able to confirm if this is the expected behavior ? If so,
>  is there anyway that I can batch multiple inserts and ensures that
> these batch of files can be committed at the same time, and rollback
>  all together if any of the file has an error ?
>
> Thank you very much for your help. 

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Basex: basexhttp Failing to Start with "Server is running or permission was denied"

2016-05-18 Thread Dirk Kirsten
Hello Sovello,

looks like there is already another service (most likely another
instance of BaseX server) running on port 1984. Please note that by
default there are two ports opened for the basexhttp server: One for the
BaseX server (default 1984) and another one for the Jetty application
container (default 8984).

You can define another port using the -h argument

Hope that helps, Dirk


On 05/18/2016 05:10 PM, Sovello Hildebrand Mgani wrote:
> Hi!
> I have downloaded BaseX 8.4.4 and running it on Ubuntu 14.04[.4]
> I have added basex/bin to $PATH so I can be able to run basex,
> basexhttp ecc.
> I can successfully run basex and basexserver. RUnning the HTTP server
> fails with this message
>
> *$ basexhttp*
> [main] INFO org.eclipse.jetty.server.Server - jetty-8.1.18.v20150929
> [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO
> JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
> [main] INFO / - Aliases are enabled! Security constraints may be
> bypassed!!!
> Server was started (port: 1984).
> [main] INFO org.eclipse.jetty.server.AbstractConnector - Started
> SelectChannelConnector@0.0.0.0:8984
> <http://SelectChannelConnector@0.0.0.0:8984>
> HTTP Server was started (port: 8984).
> Server is running or permission was denied.
> Server was stopped (port: 1984).
>
> and the output when I run *
> $ basexhttp -d*
> DEBUG: true
> BaseX 8.4.4 [HTTP Server]
> [main] INFO org.eclipse.jetty.server.Server - jetty-8.1.18.v20150929
> [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO
> JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
> [main] INFO / - Aliases are enabled! Security constraints may be
> bypassed!!!
> WEBPATH: /opt/oim/basex/webapp
> DEBUG: true
> Server was started (port: 1984).
> [main] INFO org.eclipse.jetty.server.AbstractConnector - Started
> SelectChannelConnector@0.0.0.0:8984
> <http://SelectChannelConnector@0.0.0.0:8984>
> HTTP Server was started (port: 8984).
> java.net.BindException: *Address already in use*
> at java.net.PlainSocketImpl.socketBind(Native Method)
> at
> java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
> at java.net.ServerSocket.bind(ServerSocket.java:375)
> at java.net.ServerSocket.bind(ServerSocket.java:329)
> at org.basex.BaseXHTTP$StopServer.(BaseXHTTP.java:430)
> at org.basex.BaseXHTTP.(BaseXHTTP.java:147)
> at org.basex.BaseXHTTP.main(BaseXHTTP.java:52)
> Server is running or permission was denied.
> Server was stopped (port: 1984).
>
> Which shows address is already in use.
> I only have apache2 and have run apache2 and tomcat earlier on the
> same laptop without issues, and I don't have any service that is
> listening on that port 8984.
>
> (I have tried running BaseX from version 8.0 and get the same errors).
> Am not sure what is not OK.
>
> Can you give me pointers to resolve this?
>
> Cheers
>
> -- 
> :: Sovello Hildebrand Mgani ::
>
>
>
> --If you teach man to fish, you'll feed him a lifetime--

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] question

2016-05-17 Thread Dirk Kirsten
Hello Rob,

sorry, but Christian is currently on a well-deserved vacation so you
will have to either wait or I (and maybe others) try as good as we can
to help as well.

However, I didn't really get what you want to achieve. You say you want
to get "positions of each node amongst its siblings", but in your query
you access ancestors? Maybe you could give a small example with a small
example data set and your expected output.

Cheers, Dirk


On 05/17/2016 03:51 PM, Rob Stapper wrote:
>
> Hi Chistian,
>
> In order to get some path to the element that is being processed I
> hoped that the following statement [ 1] would return a sequence of
> positions of each node amongst its siblings.
>
> Unfortunately it only returns a bunch of: 1.
>
>  
>
> [ 1] $element/ancestor-or-self::* ! ./fn:position()
>
>  
>
> Should this work?
>
> Is there some other ;-) clever way to retrieve a path to a random
> element that is being processed?
>
>  
>
> TIA for your reply,
>
>  
>
> Rob Stapper
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] How to restrict access to restxq functions just for the same domain

2016-05-13 Thread Dirk Kirsten
Hello Ioan,

I am not sure whether I correctly understood your issue. So you want to
start Tomcat in a way that it serves only to localhost? This is an issue
with Tomcat and I am sure there are ways to handle this. However, I
don't really get what is has to do with the REST services provided by Basex?

Using the build-in jetty web server from BaseX it is usually enough to
bind the port to 127.0.0.1 in the jetty.xml. I would expect Tomcat to
have a similar mechanism.

Cheers
Dirk

On 05/12/2016 07:58 PM, Ioan Fericel wrote:
> Hi,
>
> I seemed that this is the behavior if disabling REST Service in
> web.xml (BaseX.war deploymented on Tomcat), but this does not happen.
> The surprise is that the functions are accessible from anywhere, if
> access is not protected by other methods.
>
> I'm doing wrong, what should be setting? I use BaseX 8.3.
>
> Thanks for any guidance!
> Ioan

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Xquery recursion and db:add() - stack overflow

2016-05-12 Thread Dirk Kirsten
Hello Lars,

just a thought (and really just a pointer, I am neither a purely
functional guy and also I feel like I am missing something obious...):
Maybe you could rewrite the recursive approach using higher order
functions. Consider a query like the following

hof:scan-left(1 to 100,
  map { "token": "starttoken" },
  function($result, $index) {
let $req := http:send-request(,
"http://google.com?q=; || $result("token"))
return map {
  "result": $req,
  "token" : $req//http:header[@name = "Date"]/@value/data()
}
})

It will issue 100 requests to google and use some specific token from
the query before (in this case I used the date). This will output a
sequence of the map entries and in a subsequent step you could return
only the actual result values.

Best regards, Dirk


On 05/12/2016 12:55 PM, Lars Johnsen wrote:
> Thanks Johan and Matti for useful suggestions. 
>
> Cutting down on the chunks seems to be a viable alternative. 
>
> It would have been nice, though,  to have a robust harvester in XQuery
> that could take on anything, although the recursive version works fine
> as long as the dataset consist of a couple of  thousand entries.
>
> Best,
> Lars
>
> 2016-05-12 8:16 GMT+02:00 Lassila, Matti <matti.j.lass...@jyu.fi
> <mailto:matti.j.lass...@jyu.fi>>:
>
> Hello,
>
> If your case allows using external tools for harvesting, I can highly
> recommend metha (https://github.com/miku/metha) which is a fairly full
> featured command line OAI-PMH harvester.
>
> Best regards,
>
> Matti L.
>
> On 11/05/16 18:31 , "basex-talk-boun...@mailman.uni-konstanz.de
> <mailto:basex-talk-boun...@mailman.uni-konstanz.de> on behalf
> of Johan Mörén" <basex-talk-boun...@mailman.uni-konstanz.de
> <mailto:basex-talk-boun...@mailman.uni-konstanz.de> on behalf of
> johan.mo...@gmail.com <mailto:johan.mo...@gmail.com>> wrote:
>
> >Maybe there is some other way to get the data over. I'll have a
> talk with
> >the guys providing the OAI-endpoint.
>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] dba lags on replace resource

2016-05-11 Thread Dirk Kirsten
Hello Marco,

sorry for letting you wait. It sound like a bug in the DBA. However, I
was unable to reproduce the issue. Could you please clarify what you did?

I tried (using 8.4.4.):
 - Created a new database and added a resource
 - I replaced this resource using db:replace within the DBA.
 - Checked the database tab (i.e. http://localhost:8984/dba/databases),
but the "resources" column did show the correct count of 1.

Cheers
Dirk

On 05/11/2016 02:42 PM, Marco Lettere wrote:
> Hi all,
> I have a single resource in a db. I perform several replace operations
> on that resource. The dba interface shows an increasing number of
> resources available in the db according to the number of replace
> operations performed.
> To get the count of resources back to 1 I need to optimize the database.
> When opening the database the visible content is however correct
> (showing the only one resource).
> Feels like dba is somehow lagging the information displayed with
> respect to the db content ....
> Regards,
> Marco.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Xquery recursion and db:add() - stack overflow

2016-05-11 Thread Dirk Kirsten
Hello Lars,

if you have a deep recursion Java will at some point hit its stack size
limit. Have you already tried to simply increase the Java stack size,
e.g. by passing the parameter -Xss2m to the JVM?

Cheers
Dirk

On 05/11/2016 01:43 PM, Lars Johnsen wrote:
> The following code generates the error "Stack Overflow: try tail
> recursion?" 
>
> The code reads in bibliographic data using OAI-PMH and updates a
> database for each chunk of data. With OAI-PMH, only part of the data
> is available for each request, so the server returns a resumption
> token if there are more data available. 
>
> The xquery function making the queries is implemented recursively
> preceded by a database update request (see the last two lines) for
> each call. Is it db:add() that causes the stack overflow? The
> recursion cannot be placed further towards the end!
>
> declare %updating function local:getResumption($token) {
>  if (empty($token)) then 
> ()
>  else
> let $http-request := http:send-request($http-option, $URL ||
> $token)
> let $result := 
> if ($http-request instance of node()) then
>  $http-request
>else
>  {$http-request}
> 
> let $resume := $result//oai:resumptionToken/text()
> return  (
> db:add($database,element chunk {$result//oai:metadata},
> $path) , 
> local:getResumption($resume)
> )
>  };
>
> Best,
> Lars

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Stopping the http server

2016-05-10 Thread Dirk Kirsten
Hi France,

I don't think this is possible using the BaseX start script. However, is
there any particular reason why you wouldn't use the command you cited
here from the documentation?

The problem in this case with the BaseX start script is that BaseX
starts Jetty as an embedded service and I don't think we have a
mechanism in this to pass on parameters to Jetty. However, using the
jetty-runner you can achieve the same result, just the other way round:
you start jetty and embed Jetty. This way you can also add the necessary
starting parameters to Jetty.

Of course you are also free to write a shell script like the BaseX start
scripts to simplify startup.

Cheers,
Dirk

PS: For anyone wondering: Our head architect Christian is on vacation,
so for a while you will have to live with us mere humans left in the
office for support.

On 05/08/2016 08:12 PM, France Baril wrote:
> Hi, 
>
> A client of mine has multiple users who are able to start/stop the
> server. The issue though is that the person who starts the server is
> the only one who can stop it. 
>
> Some research led to this site that explains how to use secret keys to
> allow for stopping the server
> http://www.eclipse.org/jetty/documentation/current/runner.html.
>
>
> Configuring stop
>
> You can configure a port number for jetty to listen on for a stop
> command, so you are able to stop it from a different terminal.
> This requires the use of a "secret" key, to prevent malicious or
> accidental termination. Use the --stop-port and --stop-key
> parameters as arguments to the jetty-runner:
>
> > java -jar jetty-runner.jar --stop-port 8181 --stop-key abc123> java 
> -jar jetty-runner.jar --stop-port 8181 --stop-key abc123
>
> Then, to stop jetty from a different terminal, you need to supply
> the same port and key information. For this you’ll either need a
> local installation of jetty, the jetty-maven-plugin
> 
> <http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html>,
> the jetty-ant plugin
> 
> <http://www.eclipse.org/jetty/documentation/current/ant-and-jetty.html#jetty-ant>,
> or write a custom class. Here’s how to use a jetty installation to
> perform a stop:
>
> > java -jar start.jar --stop-port 8181 --stop-key abc123 --stop> java 
> -jar start.jar --stop-port 8181 --stop-key abc123 --stop
>
>
> In our case, Jetty is started through the BaseX start script. Is there
> any way we can use a secret key as explained above through the BaseX
> start/stop server scripts?
>
> Thanks!
>
> -- 
> 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>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



[basex-talk] XQuery Introduction in French

2016-04-05 Thread Dirk Kirsten
Bonjour,

just a little pointer: If you speak french and are new to XQuery (and
especially if you are in the digital humanities) the following chapters
from Farid Djaïdjas thesis might be of interest to you:

"XQuery pour les Humanités Numériques"
http://files.basex.org/publications/dummies/XQuery%20pour%20les%20Humanit%e9s%20Num%e9riques.pdf


This introduction and some others introductions and further material to
get you started can be found at
http://docs.basex.org/wiki/Getting_Started#Tutorials_and_Slides

Bien cordialement
Dirk

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Sharing a read-only database between multiple BaseX instances

2016-03-19 Thread Dirk Kirsten
Hello Christophe,

that should be absolutely fine.

Cheers
Dirk

On 03/17/2016 01:55 PM, Christophe Marchand wrote:
> Hello,
>
> I have a collection which is read-only. This collection is used as 
> source for multiple XQuery update operations, operations which do not
> modify this read-only collection.
> For performance questions, I want to parallelize my XQuery operations.
> So I want to have multiple BaseX instances - say 8 - sharing exactly
> the same read-only collection, each instance performing a XQuery
> update on a small amount of data
>
> As this collection is read-only, may I physically copy files (after
> import) from an instance to another, if instances are on different
> hosts, and may I symlink collection files from an instance to another
> if instances are on the same hosts ?
> When I import data in the "read-only" collection to initialize it,
> only one instance is started...
>
> Best,
> Christophe
> -- 
>
>
>   Christophe MARCHAND
>
> Consultant Formateur
> cmarch...@oxiane.com <mailto:cmarch...@oxiane.com>
> LD : (+33)1 84 19 19 76
> GSM : +33 (0)6 23 41 09 17
>
>   oxiane
>
> 98, avenue du Général Leclerc
> 92100 Boulogne-Billancourt
> Standard : (+33)1 55 60 76 72
> Fax : (+33)1 55 60 76 73
> www.oxiane.com <http://www.oxiane.com>
>
>
> Notre catalogue formations 2016
>
> Notre catalogue formations 2015
> <http://www.oxiane.com/wp-content/uploads/2015/11/OXiane_Catalogue_2016.pdf>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Repository. Verwendung von Modulen.

2016-03-15 Thread Dirk Kirsten
Dear Oleg,

please be aware that this is an English-speaking mailing list as most of
our users don't speak German. I hope you are able to understand my response.

I am not sure what you mean you imported datas.xml from the Datasbase
Properties window. I guess you imported the document there. However, you
also have to open the database when running your query. Your construct
"//email-group" requires a context and therefore you need some
referenced database. you could instead write
db:open("yourdatabase")//email-group or open your database before
running the query.

One note: Normally in XQuery, we don't use camel case like getGroups for
function names, but a hyphen, so it would be get-groups()

Cheers
Dirk

On 03/14/2016 02:23 PM, Oleg Duvanayev wrote:
> Sehr geehrte Damen und Herren,
>  
> ich bitte um Unterstützung bei der Lösung einer kleinen Herausforderung.
> Ich habe ein Modul in das Verzeichnis „BaseXRepo“ eingefügt. Hier ist
> den Inhalt der Datei:
>  
> xquery version "1.0";
> module namespace m = 'http://basex.org/modules/hello';
> declare function m:getGroups() {
>   for $re in //email-group
>   return $re
> };
> declare function m:say() {
>  'hallo world!'
> };
>  
> Nun möchte ich die Funktion getGroups() abfragen:
>  
> import module namespace m = 'http://basex.org/modules/hello' at
> 'mail-dispather.xqm';
> m:getGroups()
>  
> Und ich bekomme die Fehlermeldung:
>  
> Error:
> Stopped at /home/admin/BaseXRepo/mail-dispather.xqm, 6/14:
> [XPDY0002] root(): no context value bound.
> Stack Trace:
> - /home/admin/BaseXRepo/request.xq, 3/13
> Compiling:
> - rewriting descendant-or-self step(s)
> - simplifying flwor expression
> Query:
> import module namespace m = 'http://basex.org/modules/hello' at
> 'mail-dispather.xqm'; m:getGroups()
> Optimized Query:
> declare function m:getGroups() { root()/descendant::email-group };
> m:getGroups()
> Query plan:
> 
>   
> 
>   
>   
> 
>   
>   
> 
>
> Ich mache alles aus dem BaseXGUI. Die Daten (datas.xml) habe ich aus
> dem Properties-Fenster "Database properties" importiert.
> Ich verwende BaseX 8.3.1 Beta.Das Artikel 
> http://docs.basex.org/wiki/Repository habe schon auch gelesen.
>  
>  
> Wenn ich aber direkt den Inhalt der Funktion „getGroups()“ ausführe,
> dann alles funktioniert wunderbar.
>  
> Ich verstehe nicht, woran liegt das Problem. Oder wie meinen Aufruf
> der Funktion richtig aussehen muss?
>  
> Ich bitte um Hilfe
>  

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Parallel execution

2016-03-02 Thread Dirk Kirsten
sorry, last email was sent to early, my thunderbird is out of control...

So,using an annotation one could write

%async map:for-each(map { 1: 2, 3: 4 }, function($a, $b) { $a + $b })

Seeing Christians mail in the meantime I guess my idea of an annotation
is basically the same idea as the pragma. What could be the benefit of a
pragma here as can we simply not use an annotation here for some reason
I don't see at the moment, Christian?

But I do think the approach would (regardless whether it uses a pragma
or an annotation) be viable as well.

Cheers
Dirk

On 03/02/2016 05:44 PM, Christian Grün wrote:
> Hi Klāvs,
>
> Your feedback is welcome!
>
>> ```xquery
>> for async $i in 1 to 10
>> return fetch:text("http://example.com/magic-story/for-number/; || $i)
>> ```
>>
>> Problem here is that you need to introduce a new keyword to the language. I
>> am just trying to figure out if there could be a solution like this.
> That’s true (and the keyword wouldn’t change the result at all). One
> alternative could be to use a pragma. The following query is valid
> XQuery 1.0:
>
>   declare namespace basex = 'http://basex.org';
>   for $i in (#basex:async #) { 1 to 10 }
>   return $i * 2
>
>> for $i in 1 to 10
>> return
>> fetch:text-with-implicit-parallel-execution-characteristics("http://example.com/magic-story/for-number/;
>> || $i)
> The pragma could also be attached to the return expression, but in
> many cases (in particular after function inlining), FLWOR expressions
> can get pretty complex, and it would be a non-trivial task to choose
> the best for clause for parallelization.
>
> Christian

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Parallel execution

2016-03-02 Thread Dirk Kirsten
ut if
> we manage to push this further, we would have a syntax that will be
> more easily accessible to most users. Ideally, some time in future, we
> could then apply this pattern automatically if it will be absolutely
> clear that parallelization leads to faster results.
>
> Everyone: If you notice that the async:fork-join function makes your
> code faster, don’t hesitate and send us your queries.
>
> Hope this helps,
> Christian
>
> [1] https://github.com/james-jw/xq-promise/issues/15
>
>
>
>
> On Wed, Mar 2, 2016 at 10:05 AM, Dirk Kirsten <d...@basex.org
> <mailto:d...@basex.org>> wrote:
> > Labrīt Klāvs,
> >
> > well, I would the word "broken" is a strong word for something,
> which
> > still works correctly and returns the correct result. It might
> not be
> > perform optimal, but broken is something different. Also, given
> that the
> > feature is still not even one day old, you might have to be a
> bit more
> > patient with us in applying optimization techniques.
> >
> > The problem here has several dimensions:
> >  - XQuery returns results in order. So in order to not break
> BaseX we
> > would have to cache the results of the fetch and return it in the
> > correct order
> >  - This caching might be much more complex, if it is a more
> complicated
> > expression
> >  - It might not always be desirable to turn on parallelisation.
> In this
> > case you call an external HTTP server 10 times, in this case
> there might
> > be a speedup. But using fetch:text() could also point to a local
> URI and
> > to parallelize I/O is not always beneficial.
> >
> > So given the many different use cases here I don't think an implicit
> > parallelization will work here to the satisfaction of everyone.
> > Also, I invite you to read this closely related question about
> Haskell
> > on SO and the linked research:
> >
> 
> https://stackoverflow.com/questions/15005670/why-is-there-no-implicit-parallelism-in-haskell
> >
> > Cheers
> > Dirk
> >
> > On 03/02/2016 01:41 AM, Klāvs Priedītis wrote:
> >> Hello, BaseX team and community!
> >>
> >> Disclosure: I am not yet an expert on these issues and I have not
> >> fully studied the specs of XQuery.
> >>
> >> Now that Async Module is incorporated, I am wondering about
> some basic
> >> properties of xquery.
> >>
>     >> Example:
> >> ```xquery
> >> for $i in 1 to 10
> >> return fetch:text("http://example.com/magic-story/for-number/;
> || $i)
> >> ```
> >>
> >> It feels to me that the xquery processor is broken if it cannot
> figure
> >> out on its own that the fetch can be done in parallel.
> >> Why does this not work out of the box? Can it work out of the box?
> >> Wouldn't it be able to do this in parallel if a flag
> >> `can-be-optimized-for-parallel-execution` was defined for the
> >> `fetch:text`?
> >>
> >> --
> >> Veiksmi vēlot,
> >> Klāvs Priedītis
> >
> > --
> > Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
> > |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
> > |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
> > |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
> > `-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22
> >
>
>
>
>
> -- 
> Veiksmi vēlot,
> Klāvs Priedītis

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Parallel execution

2016-03-02 Thread Dirk Kirsten
Labrīt Klāvs,

well, I would the word "broken" is a strong word for something, which
still works correctly and returns the correct result. It might not be
perform optimal, but broken is something different. Also, given that the
feature is still not even one day old, you might have to be a bit more
patient with us in applying optimization techniques.

The problem here has several dimensions:
 - XQuery returns results in order. So in order to not break BaseX we
would have to cache the results of the fetch and return it in the
correct order
 - This caching might be much more complex, if it is a more complicated
expression
 - It might not always be desirable to turn on parallelisation. In this
case you call an external HTTP server 10 times, in this case there might
be a speedup. But using fetch:text() could also point to a local URI and
to parallelize I/O is not always beneficial.

So given the many different use cases here I don't think an implicit
parallelization will work here to the satisfaction of everyone.
Also, I invite you to read this closely related question about Haskell
on SO and the linked research:
https://stackoverflow.com/questions/15005670/why-is-there-no-implicit-parallelism-in-haskell

Cheers
Dirk

On 03/02/2016 01:41 AM, Klāvs Priedītis wrote:
> Hello, BaseX team and community!
>
> Disclosure: I am not yet an expert on these issues and I have not
> fully studied the specs of XQuery.
>
> Now that Async Module is incorporated, I am wondering about some basic
> properties of xquery.
>
> Example:
> ```xquery
> for $i in 1 to 10
> return fetch:text("http://example.com/magic-story/for-number/; || $i)
> ```
>
> It feels to me that the xquery processor is broken if it cannot figure
> out on its own that the fetch can be done in parallel.
> Why does this not work out of the box? Can it work out of the box?
> Wouldn't it be able to do this in parallel if a flag
> `can-be-optimized-for-parallel-execution` was defined for the
> `fetch:text`?
>
> -- 
> Veiksmi vēlot,
> Klāvs Priedītis

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] About user names

2016-02-28 Thread Dirk Kirsten
Hello France,

it is quite unusual to use the Database users as web application users.
If you develop an RESTXQ application, queries are executed as the same
user if you do not specifiy it, e.g. using eval.

So what we usually do (and what I would expect to be the normal use
case) is to have some kind of user database with user names and
passwords and to check this during login and access restriction checks.

Or is there any particular reason why you would want to user database
users as web application users?

Cheers,
Dirk

On 02/27/2016 06:14 PM, France Baril wrote:
> Hi, 
>
> I'm looking at the user module because I want to implement a login
> feature on one of my web application. More specifically, I'm looking
> at the restrictions: http://docs.basex.org/wiki/Valid_Names#Valid_Names
>
> For web applications, it is very usual for people to use an email as a
> username. The restriction on the period character is very annoying in
> that regard.
>
> I understand why it's a restriction on database names, but for user
> names it creates a limit on the ability for less frequent users to
> access the site. Most people remember which email they used or have
> only 2 or 3 to try. Passwords are saved in keychains. However,
> remembering a username... pfff!
>
> Is there any way that the restrictions on user names could be adapted
> to allow for characters that are valid for an email address in the
> near future?
>
> -- 
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com <mailto:france.ba...@architextus.com>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] BaseX and Git versioning of XML at the same time

2016-02-10 Thread Dirk Kirsten
Hi Enea,

I think your best fit is to use the WRITEBACK option (see
http://docs.basex.org/wiki/Options#WRITEBACK). Instead of creating BaseX
databases you then should simply query the files within your filesystem
(e.g. by using doc()) - So basically want you propose yourself in
question 4.

There is no connection in the way you propose in question 3, incoming
data should not be connecting to a database in the way you describe here.

One option might be to use BaseX WebDAV capabilities and sync the XML
files, but I guess the filesystem option is more convenient. But please
note: Of course operations will be significantly slower on the file
system than on importet database documents, as the storage format BaseX
uses internally is highly optimized for performance.

Cheers
Dirk

On 02/10/2016 01:33 PM, Enea Parimbelli wrote:
> Dear all,
> I'm Enea from Italy (working at the university of Pavia) and this is
> my first email to this list and I hope you'll forgive my dumb question. 
> For one of my projects I was planning to use BaseX to be able to run
> Xqueries to manipulate a bunch of XMLs that I have on my filesystem
> (i.e. to take advantage of what XQuery can do vs manual editing of the
> xml files). 
> At the same time I would like to have a version control system (Git in
> my case) control my files to be able to diff, branch, revert changes etc.
> However the way BaseX internally stores files is preventing me from
> doing this easily.
>
> Here is an example of what I have in mind:
> 0. I have a bunch of xmls in a folder (versioned with a git repo)
> 1. I create a baseX database from these
> 2. Run a bunch of updates/edits on the files using Xquery processor
> from basex
> 3. move back to git to diff what I've accomplished, commit, etc.
> 4. (possibly more advanced, not sure if I really need this) I want to
> be able to checkout a previous version of the files and have basex do
> the same (i.e. if I run a query now I want it to run on the version of
> the xmls that I have currently checked-out in my filesystem)
>
> Here are the (dumb) questions:
> 1. Is there a way for basex (maybe some config settings when I create
> the database?) to work keeping on the plain xml files? In a way that
> every update query would actually change the original xml files (which
> I can view with a plain text editor even "outside" the basex environment)?
> 2. Is the only way of immediately seeing the changes I made to the xml
> files to export the database after every update?
> 3. (assuming 1 is doable) Would it be possible to have baseX recognize
> the changes made to the xml files using an external editor (i.e. not
> through xqueries run in basex)?
> 4. From your experience is BaseX the proper tool for my purposes? It
> feels to me that I merely want to use its xquery processor
> capabilities (and I don't need the full-fledged database) while
> keeping the files plainly stored in my filesystem... any suggestion on
> alternative options if baseX doesn't sound like the right one?
>
> Thanks in advance for the help,
> and congratulations on the great work (I used basex in the past in a
> more orthodox way and was impressed by the numerous nice features...
> including being the nice GUI and the hassle-free integration with tomcat!)
>
> Best regards,
> Enea Parimbelli
>
> -- 
> Dr. Enea Parimbelli
> Post-doctoral research fellow
> Laboratory for Biomedical Informatics "Mario Stefanelli"
> Department of Electrical, Computer and Biomedical Engineering
> University of Pavia, Italy
> e-mail: enea.parimbe...@gmail.com <mailto:enea.parimbe...@gmail.com>
> phone: +39-0382-985057 <tel:%2B39-0382-985057> +39-0382-985981
> <tel:%2B39-0382-985981>
> http://www.labmedinfo.org/people/parimbelli

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Embedding BaseX in Clojure web app, pointers needed

2016-01-19 Thread Dirk Kirsten
Hello Marc,

I have no idea how Clojure works (but would be very interested, but time
is a scarce resource...), but according to
https://clojuredocs.org/clojure.core/import you should be able to simply
import Java classes/libraries. If this is possible it should be a simple
process: Put the BaseX.jar into the library path and import the
necessary classes (you can take a look at our Java examples in the wiki,
should work the same).

Well, if your pirgamm is not client/server oriented I would definitely
try to embed BaseX. The main benefit of the BaseX Client/Server version
is that you can access it with multiple processes at the same time. Of
course, the client version is theoretically slower (it has to send stuff
over sockets, It has to create/parse TCP packets and it might be a
significant overhead to use TCP if you have a rather small query or
result set. But this overhead could also be insignificant, if you don't
have this and your client/server have a fast connection (i.e. on the
same server or the same network).

Cheers
Dirk

On 01/18/2016 11:49 PM, Marc van Grootel wrote:
> Hi,
>
> I'm considering to write a web layer for BaseX based in Clojure. It
> may be a somewhat longer term project but I would like to bring XML
> and BaseX closer to Clojure programming. Clojure web apps usually are
> able to run under various servers/containers (Jetty/Netty etc.) and I
> would like to be able to use Clojure libraries to handle things like
> request routing, security and authentication outside of BaseX/XQuery.
>
> Some questions that I have while I'm orienting myself. Some of it
> touches on integration areas that are quite new to me so I am happy to
> get some general pointers that I can use to dig further.
>
> For Clojure I found only one BaseX client library [1] which wraps the
> standard Java TCP client and it seems to work fine.
>
> But I have some broader questions such as
>
> - Choosing between using the client or much more intimately embedding
> BaseX as a library. The latter is probably much more complex but I'm
> figuring this is the only way to get a good integration as the TCP
> client is rather limited in functionality. But where to start? What
> layers of the existing servlet integration to peel off, which ones to
> keep. Is BaseXServer.java a good starting point?
>
> - Is the TCP client generally slower than via the Java API? A couple
> of queries via clj-basex didn't impress me much qua speed (compared to
> same query via the GUI).
>
> Any starting points or general considerations that could help me prune
> the (re)search tree are very much appreciated.
>
>
> --Marc
>
> [1] https://github.com/kouphax/clj-basex

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 91 68 276, Fax: 0049 7531 20 05 22



Re: [basex-talk] Security

2016-01-15 Thread Dirk Kirsten
Hello Tim,

The wiki page you point to seems to be very outdated. More relevant for
your questions i the page http://docs.basex.org/wiki/User_Management

1) This is not possible, permission levels are always granted on the
database level. If you want to do that, you should create new databases
for these documents. There is no harm in having many databases, as it is
a rather lightweight construct and you can query over all databases in
your system in one query.

2) This is a completely separate thing. In the point before we talked
about the database level, but now we are in an application level. It
heavily depends on which technology you use, most prominently RESTXQ and
our REST interface come to mind. With RESTXQ each endpoint could have
some application-specific function e.g. user:check-login() which would
throw an error if a not-authenticated user is attempting to access the
site. This is the responsibility of the application designer to provide
these access restrictions.

3) We currently do not support this, but I think this is a good idea.
Adding roles to our user management seems like a good idea to me. But
again, this is just on the database level.

4) Well, users want to do all sorts of things and desire a lot - The
question is if it is really desirable. Imagine a node-level security:
You would have to check this all the time when evaluating the query and
this will be a significant performance drop. I am pretty sure the
majority of users would not be happy with that. This is also why I am
quite sure we will not be more specific in our security schemas than
using the database level (especially, because the user is free to split
different security-aware nodes by him/herself and put them into
different databases).

Cheers,
Dirk

On 01/15/2016 01:25 AM, Finney, Tim wrote:
>
> Hi Everyone,
>
>  
>
> Sorry if this is a dumb question. What is a good way to do security in
> BaseX? I found a stub here:
>
>  
>
> http://docs.basex.org/wiki/Security:_Use_Cases
>
>  
>
> What I would like is to be able to restrict who can do what with a
> database. Here are a few things I’d like to be able to do:
>
>  
>
> 1.  Grant create, read, update, and delete permissions on  each
> document in a database, and have a default mask for a database document.
>
> 2.  Say whether a user can or cannot execute a function or visit a
> URL (and get something besides a 404).
>
> 3.  Allow the creation of roles which can be assigned to users.
> (Having a particular role allows all users with that role to do
> particular things, like update docs, or visit particular URLs.)
>
> 4.  No doubt there are more desiderata. E.g. one might conceivably
> want to be able to grant permissions at the node level within a document.
>
>  
>
> Any pointers?
>
>  
>
> Best,
>
>  
>
> Tim Finney
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Sizing BaseX Server

2015-12-01 Thread Dirk Kirsten
Hello Christophe,

that's easy: The more you got, the better it is ;)

More serious: It is hard, if not impossible, to tell. This very much
depends on your use case and how you intend to use BaseX in your
process. As a traditional database and having lots of read/write access,
you are most likely I/O bound. However, you can also do complex
operations using XQuery, so you could be CPU bound.

I find it almost always beneficial to use SSDs instead of traditional
HDDs, but again: If you never touch the disk at all, this wouldn't make
a difference (but it also decreases the BaseX startup time, which is nice).

The use cases just differs to much for BaseX - you can use BaseX
embedded into your smartphone application or on a large zServer, so it
is really though to give a general advice. For a practicable approach I
would always recommend you run your application at some standard server
and take a look using Java profiling where BaseX is bound and then
increase the according component.

Cheers
Dirk

On 12/01/2015 01:51 PM, Christophe Marchand wrote:
> Hello,
>
> I'm looking at documentation about sizing a basex server computer.
> What's best : kind of processor, number of cores, RAM, disk-system,
> according to database size.
>
> Is there something in documentation on these subjects ?
>
> Best regards,
> Christophe
>
>
> -- 
>
>
>   Christophe MARCHAND
>
> Consultant Formateur
> cmarch...@oxiane.com <mailto:cmarch...@oxiane.com>
> LD : (+33)1 84 19 19 76
> GSM : +33 (0)6 23 41 09 17
>
>   oxiane
>
> 98, avenue du Général Leclerc
> 92100 Boulogne-Billancourt
> Standard : (+33)1 55 60 76 72
> Fax : (+33)1 55 60 76 73
> www.oxiane.com <http://www.oxiane.com>
>
>
> Notre catalogue formations 2015
>
> Notre catalogue formations 2015
> <http://www.oxiane.com/wp-content/uploads/2014/12/Oxiane_Catalogue-Formation-2015.pdf>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Sizing BaseX Server

2015-12-01 Thread Dirk Kirsten
Hello Christophe,

I would see having a virtual machine as a big plus, not a negative. So
in case you really see a bottleneck you could simply demand more CPU,
RAM or whatever from your hosting provider and it will be a matter of
clicks instead of actually changing your hardware.

Cheers
Dirk

On 12/01/2015 03:20 PM, Christophe Marchand wrote:
> Ok, thanks a lot, Dirk. I had the same feeling, SSD, lot of RAM, big
> procs, etc...
>
> The problem I have is the server will be a virtual machine, and I have
> to give sizing infos to infra to let them provision VMs...
>
> Thanks again,
> Christophe
>
>
>
> Le 01/12/2015 15:06, basex-talk-requ...@mailman.uni-konstanz.de a écrit :
>> 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: Sizing BaseX Server (Dirk Kirsten)
>>
>>
>> --
>>
>> Message: 1
>> Date: Tue, 1 Dec 2015 15:06:03 +0100
>> From: Dirk Kirsten <d...@basex.org>
>> To: Christophe Marchand <cmarch...@oxiane.com>
>> Cc: basex-talk@mailman.uni-konstanz.de
>> Subject: Re: [basex-talk] Sizing BaseX Server
>> Message-ID: <565da94b.2090...@basex.org>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hello Christophe,
>>
>> that's easy: The more you got, the better it is ;)
>>
>> More serious: It is hard, if not impossible, to tell. This very much
>> depends on your use case and how you intend to use BaseX in your
>> process. As a traditional database and having lots of read/write access,
>> you are most likely I/O bound. However, you can also do complex
>> operations using XQuery, so you could be CPU bound.
>>
>> I find it almost always beneficial to use SSDs instead of traditional
>> HDDs, but again: If you never touch the disk at all, this wouldn't make
>> a difference (but it also decreases the BaseX startup time, which is
>> nice).
>>
>> The use cases just differs to much for BaseX - you can use BaseX
>> embedded into your smartphone application or on a large zServer, so it
>> is really though to give a general advice. For a practicable approach I
>> would always recommend you run your application at some standard server
>> and take a look using Java profiling where BaseX is bound and then
>> increase the according component.
>>
>> Cheers
>> Dirk
>>
>> On 12/01/2015 01:51 PM, Christophe Marchand wrote:
>>> Hello,
>>>
>>> I'm looking at documentation about sizing a basex server computer.
>>> What's best : kind of processor, number of cores, RAM, disk-system,
>>> according to database size.
>>>
>>> Is there something in documentation on these subjects ?
>>>
>>> Best regards,
>>> Christophe
>>>
>>>
>>> -- 
>>>
>>>
>>>    Christophe MARCHAND
>>>
>>> Consultant Formateur
>>> cmarch...@oxiane.com <mailto:cmarch...@oxiane.com>
>>> LD : (+33)1 84 19 19 76
>>> GSM : +33 (0)6 23 41 09 17
>>>
>>> oxiane
>>>
>>> 98, avenue du G?n?ral Leclerc
>>> 92100 Boulogne-Billancourt
>>> Standard : (+33)1 55 60 76 72
>>> Fax : (+33)1 55 60 76 73
>>> www.oxiane.com <http://www.oxiane.com>
>>>
>>>
>>> Notre catalogue formations 2015
>>>
>>> Notre catalogue formations 2015
>>> <http://www.oxiane.com/wp-content/uploads/2014/12/Oxiane_Catalogue-Formation-2015.pdf>
>>>
>>>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Cant add raw files explicitly or text index ms office docs

2015-11-25 Thread Dirk Kirsten
Hello,

which problems did you encounter? This problem should be solvable using
a small XQuery, basically putting what you describe in natural languages
in XQuery so our processor understands it.

I don't think it would make any sense to add such a specific format.
There are simply way to many possible combinations - You want archive
files extracted, others might want not to do this. In the end we would
end up with a very complex definition language - And what's the point if
we already have a standardized query language like XQuery, which can
achieve the same thing?

Cheers
Dirk

On 11/25/2015 05:38 PM, E. Wray Johnson wrote:
> Here is what I want to do: For a given folder and all its subfolders
> on my physical dive, mirror its contents including the contents of
> archives, parsing xml, json,html, text, etc. using their respective
> parser skipping invalids, and adding all other files as raw. I want
> archive files (*.zip, *.doxc) to be added as raw, however I want the
> text inside archive files like docx (ms-word) to be indexed and any
> files in the archives files that match a filter to be indexed.
>
> Note: It would be nice if there was a single db:add method that
> allowed me to specify a map of filters to parsers with options, where
> all files that do not match a filter (or are invalid) will be
> optionally added as raw.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] BaseX request from Saxon XSL transformation

2015-11-18 Thread Dirk Kirsten
Hello Christophe,

I've never done this, but I'd say that extension functions are the way
to go. If I read the saxon documentation correctly
(http://www.saxonica.com/html/documentation/extensibility/functions/),
you can use it to call Java functions from within XSLT. As BaseX is
written in Java you should be able to put the BaseX jar file into the
library path and query BaseX using Java. Many Java Examples of how to
query BaseX can be found at http://docs.basex.org/wiki/Java_Examples

Cheers
Dirk

On 11/18/2015 09:18 AM, cmarch...@oxiane.com wrote:
>
>  
>
>  
>
> Hello,
>
>  
>
> I have to query a BaseX database from a XSL transformation. Does
> someone has ever done this ? I have no idea where to look in...
>
> I use SaxonEE, so I can write an extension function, if needed...
>
>  
>
> Best regards,
>
> Christophe
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Treating SQL Results

2015-11-16 Thread Dirk Kirsten
Hello Ana,

this is actually very conveniently done using group by (you can see some
more examples of group by in our documentation at docs.basex.org).
Should look something like this:

for $row in //row
let $author := $row/column[@name = "NOMECOMPLETO"]
group by $author
return $author || ":" || string-join(($row/column[@name = "TITULO"]), ", ")

Cheers
Dirk

On 11/16/2015 12:09 PM, Ana Victória Ladeira wrote:
> Good morning.
>
> I have an XML file of the following format:
>
> 
> 
> http://www.w3.org/2001/XMLSchema-instance;>
> 
> A Adequação de Sistemas Baseados em
> Casos no Sequenciamento Inteligente de Ações
> José Pacheco de Almeida Prado
> 
> 
> Sistemas Distribuídos Inteligentes
> José Pacheco de Almeida Prado
> 
> 
> Uma Arquitetura para Planejamento
> Inteligente
> José Pacheco de Almeida Prado
> 
> 
> Navegação de robôs móveis com  Lógica
> Paracpmsistente Anotada e método de Campos Potenciais
> José Pacheco de Almeida Prado
> 
> 
> Adaptation in a Traffic Control
> System
> José Pacheco de Almeida Prado
> 
> ...
>
>
>
> The file contains titles for articles and their authors..
>
> I was asked to develop a query that returns the author's name followed
> by the titles of all of its articles, so the result would be something
> like this:
>
> :, , ...
> :, ...
> ...
>
>
> Any ideas on how can I do it?
>
> Thank you in advance.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Typo in docs?

2015-11-13 Thread Dirk Kirsten
Hello Marco,

yes, I think you are correct. I guess it could be that its not a typo,
but rather an old version which was not updated accordingly, but it also
doesn't matter as it is incorrect.
We would really appreciate if you would fix it.

Cheers
Dirk

On 11/13/2015 09:57 AM, Marco Lettere wrote:
> Hi all,
> Just one question.  The documentation page related to the json module
> states:
>
> *Signatures*  |*json:serialize*($input as node()) as xs:string|
> |*json:serialize*($input as node(), $options as map(xs:string,
> xs:string)) as xs:string|
> *Summary* Serializes the node specified by |$input| as JSON, and
> returns the result as |xs:string| instance. The node is expected to
> conform to the output created by the json:parse()
> <http://docs.basex.org/wiki/JSON_Module#json:parse> function. All
> other items will be serialized as specified for the json output method
> <http://docs.basex.org/wiki/XQuery_3.1#JSON_Serialization> of the
> official specification.
> Items can also be serialized as JSON if the Serialization Parameter
> <http://docs.basex.org/wiki/Serialization> |method| is set to |json|.
> The |$options| argument can be used to control the way the input is
> serialized.
>
>
> But I think the signature should be for item()? for the first
> parameter (since it allows also for maps) isn't it?
>
> In effect
>
> inspect:function(json:serialize#2)
>
> returns
>
> http://basex.org/modules/json;>
>   
>   
>   
> 
>
> If it's confirmed I could proceed with fixing it.
> Regards,
> Marco.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Generating consecutive integers in a for loop

2015-10-20 Thread Dirk Kirsten
Hello Ron,

not Christian, but I try anyway to help you :)

If you say yout want a "generate consecutive numbers in a for loop" are
you aware of the "at" construct for flwor expression, e.g.

for $x at $pos in 10 to 19 return $pos

will return the numbers 1 to 10, i.e. is a consecutive counter.

Cheers
Dirk


On 10/20/2015 03:23 PM, Ron Katriel wrote:
> Hi Christian,
>
> Is there a way to generate consecutive numbers in a for loop in BaseX?
> I am iterating over a collection of XML files from clinicaltrials.gov
> and need to tag each output record with a unique ID starting at 1. I
> have seen many discussions of this (some involving incrementing a
> counter in a dummy node) but have not found a clean solution that
> actually works. For example, I tried to adapt the code snippet you
> provided
> in https://mailman.uni-konstanz.de/pipermail/basex-talk/2010-May/000259.html 
> to
> create a function that accomplishes this without referencing an
> auxiliary file (see below) but cannot get past the perplexing syntax
> error ([XQST0049] Duplicate declaration of static variable $root.).
>
> Thanks,
> Ron
>
>
> declare variable $root := ;
>
> declare function local:getuid () as xs:integer {
>   let $count := $root/@count
>   return (
> insert node  into $root,
> replace value of node $count with $count + 1
>   )
> };
>
> On October 19, 2015 at 5:12:19 PM, meumapple (meumap...@gmail.com
> <mailto:meumap...@gmail.com>) wrote:
>
>> Hi Christian,
>>
>> I think there is a bug for Mac (10.x). Those options do no work and
>> typing quotes is really difficult. First I need to press the button
>> twice in order for one quote to appear. Then whatever button I use
>> the other quote appears. And there are other strange behaviors which
>> are difficult to detail (eg the cursor is moved outside adjacent
>> quotes if the option "automatically add characters" is on).
>>
>> Whitespaces cannot be shown, only new line character (this happens
>> also on a windows machine).
>>
>> Joseph
>>
>> ps I also notice that running basexgui and basex.jar are different. I
>> added saxon9he.jar in the lib folder and it is read by basexgui but
>> not by basex.jar. Moreover basexgui sometimes runs out of memory when
>> basex.jar does not. Does this make sense?
>>
>>
>>
>> Il giorno 19/ott/2015, alle ore 14:02, Christian Grün
>> <christian.gr...@gmail.com> ha scritto:
>>
>> Hi Joseph,
>>
>> > I love using the gui but I have a hard time dealing with
>> autocomplete: is there a way to disable it in the txt editor?
>>
>> You can disable "Automatically add characters" in the Preferences
>> dialog. Could you please detail which autocompletions are particularly
>> confusing for you?
>>
>> > I think that it would also be very useful to allow view of
>> whitespaces and tabs and have a function to prettify the code itself
>> (do you know any for xquery?)
>>
>> Tabs and non-breaking spaces are visualized when activating "Show
>> invisible characters" in that same dialog.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] BasexGui

2015-10-18 Thread Dirk Kirsten
Hi Joseph,

I guess you are referring to the automatical insertion of closing
brackets and similar stuff to "autocomplete" (we don't have a true
autocomplete for more complex stuff). I am not aware that there is a way
to disable this.

You can prettify your code with Ctrl+Shift+F, see
http://docs.basex.org/wiki/Shortcuts for more magic shortcuts. I don't
think there is currently any way to visualize the whitespaces.

Cheers
Dirk

On 10/17/2015 07:21 PM, meumapple wrote:
> Hi All,
>
> I love using the gui but I have a hard time dealing with autocomplete: is 
> there a way to disable it in the txt editor? 
>
> I think that it would also be very useful to allow view of whitespaces and 
> tabs and have a function to prettify the code itself (do you know any for 
> xquery?)
>
> Thank you very much for your work!
>
> Joseph

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] xml-to-json vs json:serialize

2015-10-16 Thread Dirk Kirsten
"text")
>   %output:media-type("application/json")
> function jt:service()
> {
>   xml-to-json(
> http://www.w3.org/2005/xpath-functions;>
>   12345678
> )
> };
>
> declare
>   %rest:path("testreq")
>   %output:method("text")
>   %output:media-type("application/json")
> function jt:test()
> {
>   let $response := http:send-request(
> http://localhost:9984/jsonsrv; method="POST">
>method="text"/>
> )
>   return json:serialize($response[2])
> };
>
>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] xml-to-json vs json:serialize

2015-10-16 Thread Dirk Kirsten
Hello Hans-Jürgen,

oh, I wasn't aware of this. I was under the assumption these functions
are already included in the latest 3.1 draft, but you are indeed correct.
So your assumptions of what I meant are absolutely spot on.

Cheers,
Dirk

On 10/16/2015 01:18 PM, Hans-Juergen Rennau wrote:
> Hi Dirk,
>
> I am a little confused about your mentioning of the XQuery spec.
>
> I think the current, published working draft of version 3.1 does not
> define any XML representation of JSON - only the map/array
> representation, produced/consumed by functions
> json-doc+parse-json/serialize. But as far as I know, it is planned to
> add the functions xml-to-json and json-to-xml, defined by XSLT 3.0.
>
> So I suppose your words "the new xml-to-json specification by the
> XQuery spec" mean the so-named function to be added in the next draft,
> and "the XQuery spec mapping" probably means this function, as well as
> the function constructing maps/arrays (parse-json). But if I
> misunderstand you, please let me know.
>
> To make my point of view perhaps still clearer: the BaseX XML
> representation of JSON fills an important *gap* in the XQuery spec: a
> natural (to use your word) XML representation of JSON trees.
>
> Cheers,
> Hans-Jürgen
>
>
>
> Dirk Kirsten <d...@basex.org> schrieb am 12:21 Freitag, 16.Oktober 2015:
>
>
> Hello Marco,
>
> I am also not sure about the rationale of your question. One of the
> reasons why we have multiple JSON representations/converters is that
> at the time of introducing this there wasn't any XQuery 3.1 spec, so
> obviously we couldn't implement this. There was stuff like JsonML
> around, which we do support, and which I personally feel the same
> about as the new xml-tojson specification by the XQuery spec: It's
> quite cumbersome and impractical to work with.
>
> So we have introduced our default mapping, simply because we feel it
> is a good fit. And speaking from experience developing a rather large
> JavaScript (AngularJS) application, which uses XML as a RESTXQ
> backend, this feels rather natural and nice to work with. I didn't
> want to do the same thing with the JsonML or the XQuery spec mapping.
>
> Of course, you might have a different use case and there are many
> legitimate (or just personal preferences, which is ok as well) reasons
> to chose a different representation, but that's why we have multiple
> options.
>
> Regarding your wish for a cleaner service chaining I just want to
> mention that there is a json-to-xml function as well (so nbo need to
> use json:serialize), so the round trip should be rather logical. Maybe
> it would be possible to add the xquery spec mapping to our
> serialization options as well (given that it is already implemented in
> the functions itself, it should be at least theoretical possible to
> add it there as well), so handling would be more smoothly.
>
> Cheers,
> Dirk
>
>
> On 10/15/2015 11:04 PM, Hans-Juergen Rennau wrote:
>> Hi Marco,
>>
>> I am not quite sure if I understand your question well, but let me
>> make a couple of remarks about the rationale of treating JSON as XML.
>>
>> XML is accessible to XPath, nested maps and arrays are not. Hence any
>> non-trivial navigation of XML trees is incomparably simpler and more
>> elegant than navigation of JSON trees, representated by nested maps
>> and arrays. Similarly, the *construction* of complex XML structure is
>> often much simpler than the construction of nested maps and arrays.
>> As a consequence, the processing of JSON can often be radically
>> simplified by dealing with XML, rather than JSON: just frame your
>> processing between an initial JSON to XML transformation (json:parse)
>> and a final XML to JSON transformation (json:serialize).
>>
>> It is important to realize that there are alternative XML
>> representations of JSON. The representation defined in the XSLT 3.0
>> spec is very "clean" from a conceptual point of view, but
>> navigation-unfriendly, as the all important object member names are
>> represented by attributes, rather than element names (which are
>> restricted to "map", "array", "string", "number", "boolean", umph!),
>> resulting in a rather cluttered representation, requiring clumsy
>> XPath expressions. The alternative representation offered by BaseX
>> [1], on the other hand, looks intuitive and enables navigation which
>> is in typically cases as elegant as if the data were supplied in XML
>> to begin with. I can highly recommend dealing with JSON via the BaseX
>> XML representation, and I use this XML format also in th

Re: [basex-talk] problem with prepared

2015-09-10 Thread Dirk Kirsten
$pos in local:indice()
> for $nome in local:nome() [$pos]
> for $indirizzo in local:indirizzo()[$pos]
> for $telefono in local:telefono()[$pos]
> for $fax  in local:fax()[$pos]
> for $email  in local:email()[$pos]
> for $nazionalita  in local:nazionalita()[$pos]
> for $datanascita  in local:dataNascita()[$pos]
> let $init := sql:init("com.mysql.jdbc.Driver"),
> $conn :=
> sql:connect("jdbc:mysql://localhost:3306/DbName","user","password''),
> $stmt := sql:prepare($conn, "INSERT INTO
> informazionipersonali(idInformazioniPersonali,nome,indirizzo,telefono,fax,email,nazionalità,dataNascita)
> VALUES(?,?,?,?,?,?,?,?) ")
> let $params:=   
>{$indice} 
>   {$nome}
>   {$indirizzo}
>   {$telefono} 
>   {$fax}
>   {$email}
>   {$nazionalita} 
>   {$datanascita} 
> 
>  return sql:execute-prepared($stmt,$params)
>  
> It works,but it returns only the first row in my database, and i want
> a row for each value (indice,nome,indirizzo,)
> How can i do?
>
> - Original Message 
> Da: "Maximilian Gärber" <mgaer...@arcor.de>
> To: "basex-talk@mailman.uni-konstanz.de"
> <basex-talk@mailman.uni-konstanz.de>
> Oggetto: Re: [basex-talk] problem with prepared
> Data: 09/09/15 09:12
>
>
>
> or using a where statement
>
> for $indice at $pos in local:indice()
> for $nome at $pos2 in local:nome()
>
> let $params:= 
> {$indice}
> {$nome}
> 
>
> where $pos2 = $pos
> return $params
>
> 2015-09-09 9:05 GMT+02:00 Maximilian Gärber <mgaer...@arcor.de>:
> > Hi,
> >
> > when you join (by nesting for statements) you will always get the
> > combinations unless you provide more constraints.
> >
> > You might try something like:
> >
> > declare function local:indice() as xs:integer* {
> >
> > for $i in (1 to 10)
> > return $i
> > };
> >
> > declare function local:nome() as xs:string* {
> >
> > for $n in ('a', 'b', 'c', 'd')
> > return $n
> > };
> >
> > for $indice at $pos in local:indice()
> > for $nome in local:nome()[$pos]
> >
> > let $params:= 
> > {$indice}
> > {$nome}
> > 
> > return $params
> >
> >
> > Regards, Max
> >
> > 2015-09-08 16:20 GMT+02:00 <michele.gre...@email.it>:
> >> Hi i have following xquery:
> >> declare function local:indice() as xs:integer* {
> >> count(for $document in collection("curriculum")
> >> let $c:= document-uri($document)
> >> for $a in doc($c)
> >> order by $c
> >> return
> >> for $e in doc($c)//w:tc[.//text()="Nome"]
> >> return $e/./following::text()except
> >> (for $x in doc($c)//w:tc[.//text()="Indirizzo"]
> >> return $x//following::text()))
> >> };
> >>
> >> declare function local:nome() as xs:string* {
> >> for $document in collection("curriculum")
> >> let $c:= document-uri($document)
> >> for $a in doc($c)
> >> order by $c
> >> return
> >> for $e in doc($c)//w:tc[.//text()="Nome"]
> >> return $e/./following::text()except
> >> (for $x in doc($c)//w:tc[.//text()="Indirizzo"]
> >> return $x//following::text())
> >> };
> >> for $ indice in local:indice()
> >> let $init := sql:init("com.mysql.jdbc.Driver"),
> >> $conn :=
> >>
> sql:connect("jdbc:mysql://localhost:3306/DBName","user","password''),
> >> $stmt := sql:prepare($conn, "INSERT INTO
> >>
> 
> informazionipersonali(idInformazioniPersonali,nome,indirizzo,telefono,fax,email,nazionalità,dataNascita)
> >> VALUES(?,?,'null','null','null','null','null','null') ")
> >> for $nome in local:nome()
> >> let $params:= 
> >> {$indice}
> >> {$nome}
> >> 
> >> return sql:execute-prepared($stmt,$params)
> >>
> >>
> >> which return a combination of index and names, but i want only
> one row for
> >> each index and name.
> >> How can i do?
> >>
> >> 
> >> ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio
> email.it, per
> >> tutti i dettagli clicca qui
> >>
> >> Sponsor:
> >> Registra i domini che desideri ed inizia a creare il tuo sito web
> >> Clicca qui
>
>
> 
> ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it,
> per tutti i dettagli clicca qui
> <http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer>
>
> Sponsor:
> Soluzioni di email hosting per tutte le esigenze: dalle caselle
> gratuite a quelle professionali su piattaforma Zimbra, da quelle su
> proprio dominio a quelle certificate PEC. Confronta le soluzioni
> Clicca qui <http://adv.email.it/cgi-bin/foclick.cgi?mid=13326=20150910>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Different behavior with same query in BaseX 7.9 and 8.2.3

2015-09-09 Thread Dirk Kirsten
Hello Antoine,

this appears to be a bug in most recent BaseX version. The optimizer
seems to think the where clause is equivilant to the position predicate
and it is rewritten to

  for $d_0 in
document-node()()/descendant::fund/properties/domain[position() = 1]
return data($d_0/@reference)

i.e. without a where clause but with the position() predicate. Also, if
you return something like "return data($d/@reference) || $i" it works as
expected.

Hence, I created a new issue for this at
https://github.com/BaseXdb/basex/issues/1189.

Thanks for reporting this. Please be aware that our main developer
Christian is currently on vacation (until next week), so it will take
slightly longer to get this fixed (as I know Christian usually this
would be fixed by the end of the day). I hope this doesn't influence
your decision making process in your evaluation.

Cheers
Dirk




On 09/09/2015 11:22 AM, Antoine WOLF wrote:
> *Hi,*
> ** 
> *We are in the process of evaluating BaseX  and recently upgraded from
> version 7.9 to  8.2.3
>
>
> We have a DB “TESTDB” with 50 xml files, named Fund1.xml, Fund2.xml,
> Fund3.xml,…. each having the same structure:
>
> Fund1.xml
> --
>
> < fund>
> …
> 
> …
> 
> …
> 
> …
> 
> …
> 
>
>
> Fund2.xml
> --
>
> < fund>
> …
> 
> …
> 
> …
> 
> …
> 
> …
> 
>
> ….
> ….
>
>
>
> The following query does not behave the same on both versions :
>
>
> For $d at $i in db:open(“TESTDB”)/fund/properties/domain
> where $i < 2
> return data($d/@reference)
>
>
> Result in 7.9
> --
>
> “Fund1”
>
>
> Result in 8.2.3
> -
>
> “Fund1 Fund2 Fund3 Fund4 …”
>
>
> Is this a bug or is there something wrong with the query ?
>
>
> Best Regards,
>
> Antoine Wolf*

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] http:request timeout

2015-09-09 Thread Dirk Kirsten
Hello Marco,

looks like you are right. However, I don't think this is a deliberate
design decision, but a simple bug in our implementation. Do you think
you could send us a small pull request so we can fix this and match the
specification?

Cheers
Dirk

On 09/09/2015 12:26 PM, Marco Lettere wrote:
> Hello all,
> I think there is a mismatch in the semantics of timeout for the
> http:request datastructure. expath says it's in seconds where as the
> basex impl treats it as milliseconds. Could you confirm this?
>
> The expath states:
>
> [...]
> |timeout| is the maximum number of seconds to wait for the server to
> respond. If this time duration is reached, an error is
> thrown [err:HC006] <http://expath.org/spec/http-client#errHC006>.
> [...]
>
> whereas in the HttpClient (lines 168 and 169) the code for setting the
> timeout is the following:
>
> [...]
> final String timeout = request.attribute(TIMEOUT);
> if(timeout != null) conn.setConnectTimeout(Strings.toInt(timeout));
> [...]
>
> conn being an instance of HttpUrlConnection and the documentation of
> setConnectTimeout states it to be in milliseconds.
>
> If this is not my bad interpretation, maybe a note in the docs should
> be provided ...
> Regards,
> Marco.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Xquery collections

2015-09-03 Thread Dirk Kirsten
Ciao Michele,

welcome to the community :-)

Collections in BaseX are basically databases. You can simply open a
database e.g. by issueing the XQuery db:open('mydatabase'). This will
use all documents in your database.

You can find some more examples at http://docs.basex.org/wiki/Databases

It might also be helpful for you to read some of the Tutorials given at
http://docs.basex.org/wiki/Getting_Started like BaseX for Dummies, given
a concise introduction to BaseX.

Spero che sia d'aiuto
Dirk



On 09/03/2015 05:48 PM, michele.gre...@email.it wrote:
> Hello I Michele i'm new to basex,
> i created a collection with different documents .xml.
> I want to know how to query the entire collection e its documents at
> one xquery.
> I'm trying,but i can't.
>  
> Thanks.
> MG
>  
>
> 
> ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it,
> per tutti i dettagli clicca qui
> <http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer>
>
> Sponsor:
> Idee regalo classiche o alternative? Trova l'offerta migliore in un click
> Clicca qui <http://adv.email.it/cgi-bin/foclick.cgi?mid=13327=20150903>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] size on collection in the time

2015-09-03 Thread Dirk Kirsten
Hello Marc,

sure, a replace should lead to a true replace, i.e. the old data will be
dropped. So this sounds like a bug, but it is difficult to replicate
from what you describe.

Do you think it would be possible to make the issue reproducable, maybe
also with a smaller data set? Also, how exactly do you add documents or
do you also do any queries and maybe other updating queries?

Cheers
Dirk

On 09/02/2015 05:36 PM, Marc wrote:
> Hi,
> I have a remark about the size of the files of a collection.
> We do a lot of updates (REPLACE) with an attributes index but without
> a text index.
> I see that the size of the files grows up in the time we arrive until
> 30Go until the limit of the filessytems quota.
> When I drop the collection and recreate it from the last version of
> the files the size was only 6Go.
>
> We will redo the test with the time, but I just want to know if the
> program clears the disk use when he does a REPLACE?
>
> Marc

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Unexpected error: Improper use? Potential bug?

2015-09-03 Thread Dirk Kirsten
p://BaseX.huma-num.fr/webdav/bvm/bvm.xml
>> 17:17:00.904X.X.X.X:39091admin   200 60733.77 ms
>> 17:17:00.907X.X.X.X:39582admin   200 40712.41 ms
>> 17:17:00.909X.X.X.X:38770admin   200 80842.45 ms
>> 17:17:00.910X.X.X.X:38436admin   200 100868.15 ms
>> 17:17:01.004X.X.X.X:39090admin   200 60926.05 ms
>> 17:19:37.189Y.Y.Y.Y:39926admin   ERROR   Timeout
>> exceeded.   6.62 ms
>>
>> ... 
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Fwd: Db creation

2015-09-03 Thread Dirk Kirsten
Hello Joseph,

sorry, I didn't have much time to reply to your mail before. So, using
file:write without any optimization parameters it will most likely try
to serialize as XML and then it should replace e.g. < by . Instead,
you could use file:write-text() or set the seriaziation method
explicitely, i.e. using file:write(, , map { "method": "text" })

Using skipcorrupt should indeed work. Could you please send us the
concrete snippet you are trying to execute? And also, which BaseX
version are you using?

Cheers
Dirk

On 09/03/2015 01:05 PM, meumapple wrote:
> Hi,
>
> I forward a message I sent a few days ago which apparently did not receive 
> any answer. I am trying to open a collection of files where some of them 
> contain character entity references like  which are not declared in 
> the document and so make basex crash if I use collection()
>
> If I use file:read-text for each file I can open them, but if I then put this 
> functioni in file:write, the saved text will show   instead of < and 
> >: why?
>
> Moreover, if I create a database from the GUI and select the option "skip 
> corrupt", the database is created. However if I follow instruction here 
> http://docs.basex.org/wiki/Parsers
> In order to add single files to a db using db:add and precede the query with 
> declare option db:skipcorrupt 'true', the files are not added because  I get 
> an error message due to the not well-formed xml (which means that the 
> declaration at the beginning of the query is not read). I have tried to 
> declare other db options in the same way (ie in the prolog of a script) but 
> they seem not be read.
>
> Giuseppe
>
>

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Basex 8.2.3 data not shown, until OS restart

2015-09-02 Thread Dirk Kirsten
Hello Mansi,

are you sure both BaseX instances use the same database path (DBPATH)?
You might start them from different directories, depending on how you
start and your config files. However, you can check this in both
instances using the INFO command and check the dbpath.

Hope this helps
Dirk

On 09/01/2015 11:04 PM, Mansi Sheth wrote:
> Hello, 
>
> This is something very weird. I import bunch of XML files, into this
> latest version of based using Java API. When trying to access this
> data (via basex command line client or REST), doesn't show any
> databases at all. These databases shows up only after restarting OS.
>
> Is this a known issues ? or just me ?
>
> - Mansi

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Selective indexes

2015-09-01 Thread Dirk Kirsten
Hello Martin,

I was glad to see your second mail, because that is what I wanted to
write :)
But if you miss some features or something doesn't work as expected
don't hesitate to write.

Cheers
Dirk

On 09/01/2015 03:55 AM, Martín Ferrari wrote:
> Haha, does the selective index feature just do what I spent 30 minutes
> writing about?
> Sorry, I think my reading abilities were impaired, or I was too
> impatient to read until the end of the issue. 
>
> I'll give it a try when I have some moments, it looks pretty cool!
>
> Thanks,
>  Martín.
>
> 
> From: ferrari_mar...@hotmail.com
> To: basex-talk@mailman.uni-konstanz.de
> Subject: Selective indexes
> Date: Tue, 1 Sep 2015 01:37:31 +
>
> Hi Dirk,
> I didn't want to hijack the other thread, so I started a new one :)
>
>  I've read https://github.com/BaseXdb/basex/issues/59 and I think
> it's great!. I have a slightly different request though that I was
> holding back because I didn't want to sound abusive, but now that you
> brought it up... 
>  I might be mistaken as I haven't really debugged the code, but I
> believe that indexing could maybe take so long (for our use case
> anyway) because it indexes all the values in the xml documents. So I
> wonder whether it would be beneficial for the indexing speed to be
> able to state which specific fields to index instead of all of them.
> This would allow for having fast regularly used queries, without
> impacting insertions that much.
>
>  I can explain our use case quickly: we store XML files that are
> interchanged with third parties. We have lots of them all the time, so
> insertion speed is critical. Query speed on the other hand is not
> critical, though obviously having fast queries is a lot better than
> having slow ones. But it becomes more important as the queries lock
> the db for writing too, aside from feeling "if I just could index this
> one field", hehe. If we could just index the fields that we run most
> of our queries against, it would be perfect.
> Right now, I think we can get away with organizing resources
> inside directories and that would be enough as that seems to work
> perfectly (we'll perform a couple more tests with high volume), but I
> thought it would be really cool if we could have a similar insertion
> speed to what's achieved without indexing, by just indexing some
> fields (again, *guessing* that the cause of the decrease in speed is
> due to indexing all fields in the documents, which may or may not be
> the case).
>
> Thanks!
>  Martín.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Finding document based on filename

2015-08-31 Thread Dirk Kirsten
Hello Martin,

I would like to add that Christian just implemented selective indexes,
so if you want to index in a more granular fashion this should now be
possible. See https://github.com/BaseXdb/basex/issues/59 for more
details and of course this is not stable software yet, so use with care.
But we are happy about feedback, as always.

Regarding the initial issue: I do think using supfolders in the database
should be the easiest and fastest way. Is there any reason not to use
distinct directories instead of naming the file using some pattern?

Cheers
Dirk

On 08/31/2015 06:35 PM, Martín Ferrari wrote:
> Hi Mansi,
>  I have a similar situation. I don't think there's a fast way to
> get documents by only knowing a part of their names. It seems you need
> to know the exact name. In my case, we might be able to group
> documents by a common id, so we might create subfolders inside the DB
> and store/get the contents of the subfolder directly, which is pretty
> fast.
>  I've also tried indexing, but insertions got really slow (I
> assume maybe because indexing is not granular, it indexes all
> values) and we need performance.
>
>  Oh, I've also tried using starts-with() instead of contains(),
> but it seems it does not pick up indexes.
>
> Martín.
>
> 
> Date: Fri, 28 Aug 2015 16:52:37 -0400
> From: mansi.sh...@gmail.com
> To: basex-talk@mailman.uni-konstanz.de
> Subject: [basex-talk] Finding document based on filename
>
> Hello, 
>
> I would be having 100s of databases, with each database having 100 XML
> documents. I want to devise an algorithm, where given a part of XML
> file name, i want to know which database(s) contains it, or null if
> document is not currently present in any database. Based on that, add
> current document into the database. This is to always maintain latest
> version of a document in DB, and remove the older version, while
> adding newer version.
>
> So far, only way I could come up with is:
>
> for $db in all-databases:
>   open $db
>   $fileNames = list $db
> for eachFileName in $fileNames:
>if $eachFileName.contains(sub-xml filename):
> add to ret-list-db
>
> return ret-list-db
>
> Above algorithm, seems highly inefficient, Is there any indexing,
> which can be done ? Do you suggest, for each document insert, I should
> maintain a separate XML document, which lists each file inserted etc. 
>
> Once, i get hold of above list of db, I would be eventually deleting
> that file and inserting a latest version of that file(which would have
> same sub-xml file name). So, constant updating of this external
> document also seems painful (Map be ?).
>
> Also, would it be faster, using XQUERY script files, thru java code,
> or using Java API for such operations ?
>
> How do you all deal with such operations ?
>
> - Mansi

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Decode a RESTXQ path

2015-08-28 Thread Dirk Kirsten
Hello Kristian,

could you please elaborate what you mean by decode? Normally, you
should not have to do anything, this is just an encoding and your $query
variable should be able to handle UTF-8.

I just tested this to see if there might be a bug, but if I do e.g.

declare %rest:GET
  %rest:path(test/{$query})
  %output:method(text)
function _:test(
  $query  as xs:string
) {
  $query
}; and access it at

http://localhost/restxq/test/%F0%9F%98%83

I get back my intended smile face.

So it might help if you describe what does not work as you expect it to.
Because we want you to have a smiley face as well ;)

Cheers
Dirk

PS: At other people asking on the mailing list, Christian is currently
on vacation and I can't answer stuff I know next to nothing about (e.g.
WebDAV). So please be patient.

On 08/28/2015 12:31 PM, Kristian Kankainen wrote:
 Hello!

 I have a simplistic search path as %rest:GET
 %rest:path(search/{$query}) for an application. It all works fine
 with ASCII query string, but I can't figure out how to decode the
 string when It contains utf-8 characters.

 Best wishes
 Kristian K

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Decode a RESTXQ path

2015-08-28 Thread Dirk Kirsten
Hello Kristian,

I guess you are correct and Tomcat or nginx. I would guess that Tomcat
is the culprit (but that might be totally biased, just because I had
lots of trouble with Tomcat). However, you might want to follow the
advice given at
https://stackoverflow.com/questions/138948/how-to-get-utf-8-working-in-java-webapps
to configure the server.xml

Also, to find out whats going on you could test accessing your page
without a reverse proxy (so to see if nginx is causing the issue) and
then with Jetty instead of Tomcat. jetty is our default HTTP server, so
if you start basexhttp it will use Jetty.

Regards
Dirk

On 08/28/2015 01:24 PM, Kristian Kankainen wrote:
 Hello!

 I'll try to elaborate. :-)

 My search function is as basic as is in your test. But you can see the
 output at:
 http://tomcat.eki.ee/vadja/korpus/%F0%9F%98%83

 Can it be a problem or setting of Tomcat or anything in between the
 browser and BaseX, for example Nginx?

 Thank you for working your ass off while Christian is on vacation :-D
 Kristian K


 28.08.2015 13:43 Dirk Kirsten kirjutas:
 Hello Kristian,

 could you please elaborate what you mean by decode? Normally, you
 should not have to do anything, this is just an encoding and your
 $query variable should be able to handle UTF-8.

 I just tested this to see if there might be a bug, but if I do e.g.
 declare %rest:GET
   %rest:path(test/{$query})
   %output:method(text)
 function _:test(
   $query  as xs:string
 ) {
   $query
 }; and access it at
 http://localhost/restxq/test/%F0%9F%98%83

 I get back my intended smile face.

 So it might help if you describe what does not work as you expect it
 to. Because we want you to have a smiley face as well ;)

 Cheers
 Dirk

 PS: At other people asking on the mailing list, Christian is
 currently on vacation and I can't answer stuff I know next to nothing
 about (e.g. WebDAV). So please be patient.

 On 08/28/2015 12:31 PM, Kristian Kankainen wrote:
 Hello!

 I have a simplistic search path as %rest:GET
 %rest:path(search/{$query}) for an application. It all works fine
 with ASCII query string, but I can't figure out how to decode the
 string when It contains utf-8 characters.

 Best wishes
 Kristian K

 -- 
 Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
 |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
 |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
 |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
 `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Fastest way to get resources starting with path

2015-08-28 Thread Dirk Kirsten
Hello Martin,

as stated in our documentation at
http://docs.basex.org/wiki/Databases#XML_Documents you can further
restrict the documents in the collection via the argument.

Also, you can get all document names in a database using
db:list(database) or even stricter using a path, e.g.
db:list(database, my/path).

Cheers
Dirk

On 08/28/2015 06:35 PM, Martín Ferrari wrote:
 Hello:
 I wonder if there's a fast way to get the contents or names of the
 resources that start with a certain path. We have something like this:

 string query = @for $doc in collection()
  where substring-after(document-uri($doc),
 '/') = ' + documentName + @'
  return $doc/Root;

 But our db has millions of resources so this doesn't scale too well.
 I'd like a way to get the contents (or names) of resources in
 which the names start with a certain pattern without having to check
 all names. Is it possible?

  The alternative would be to add a field inside the xml resources,
 index on it, and perform a query.

 Thanks,
  Martín.



-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Installation of RESTXQ scripts over HTTP API?

2015-08-24 Thread Dirk Kirsten
Hello Andreas,

I do not quite understand - What use is a web service if you do not have
access over HTTP? You might have to tunnel, but this might be just the
right action.

RESTXQ files don't have to be installed, they are just read in from the
file system. Hence, every file transfer mechanism you want could be
theoretically used to transfer the files, e.g. ssh, ftp or I guess also
WebDAV is the RESTXQ-directory is used by some WebDAV server (excuse me
if this is totally wrong, I have never used WebDAV, but it should work
somehow...).

Cheers,
Dirk

On 08/24/2015 07:39 AM, Andreas Jung wrote:
 Hi there,

 I know that .xqm script are installed directly on the filesystem (compared to 
 Exist
 where the scripts are stored directly within the database). 

 Is there some way to install RESTXQ through some (HTTP) API on the filesystem?

 Background of my question: I want to deploy RESTXQ script to a pre-installed
 BaseX server where I not necessarily have access to over HTTP. In Exist-DB
 I can directly upload the scripts over WebDAV (which is very convenient) 
 ...now
 looking into a similar option in order for BaseX in order keep the deployment
 of applications as easy as possible (one click installation).

 Andreas

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Installation of RESTXQ scripts over HTTP API?

2015-08-24 Thread Dirk Kirsten
Hello Andreas,

you can write a RESTXQ-function which does exactly that, i.e. a function
accepting files and putting them into the right location in the file
system. So once the system is up, deployment can be done via HTTP. You
should secure this with a password or token for obvious reasons.

Another way would be to use a servlet container with a web interface (I
personally wouldn't recommend Tomcat, but Glassfish instead) and then
creating a war-file (.e.g via maven) and uploading it using the REST
interface or HTTP management console.

Cheers,
Dirk

On 08/24/2015 08:19 AM, Andreas Jung wrote:
 Background: 

 http://xml-director.info/

 is my project which aims to support both ExistDB and BaseX.

 In ExistDB I can manage my content, assets and code (RESTXQ) scripts
 solely over the WebDAV layer of ExistDB which makes deployments really
 easy. Deploying code to BaseX requires access to the filesystem because
 the scripts live on the filesystem and not in the database (existed).

 So the question is: is there some way to send code over HTTP to BaseX
 in order to be deployed in some way in the right place on the filesystem.

 -aj



 On 24 Aug 2015, at 8:12, Dirk Kirsten wrote:

 Hello Andreas,

 I do not quite understand - What use is a web service if you do not have
 access over HTTP? You might have to tunnel, but this might be just the
 right action.

 RESTXQ files don't have to be installed, they are just read in from the
 file system. Hence, every file transfer mechanism you want could be
 theoretically used to transfer the files, e.g. ssh, ftp or I guess also
 WebDAV is the RESTXQ-directory is used by some WebDAV server (excuse me
 if this is totally wrong, I have never used WebDAV, but it should work
 somehow...).

 Cheers,
 Dirk

 On 08/24/2015 07:39 AM, Andreas Jung wrote:
 Hi there,

 I know that .xqm script are installed directly on the filesystem (compared 
 to Exist
 where the scripts are stored directly within the database).

 Is there some way to install RESTXQ through some (HTTP) API on the 
 filesystem?

 Background of my question: I want to deploy RESTXQ script to a pre-installed
 BaseX server where I not necessarily have access to over HTTP. In Exist-DB
 I can directly upload the scripts over WebDAV (which is very convenient) 
 ...now
 looking into a similar option in order for BaseX in order keep the 
 deployment
 of applications as easy as possible (one click installation).

 Andreas
 -- 
 Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
 |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
 |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
 |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
 `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Looks like...

2015-08-21 Thread Dirk Kirsten
Hello Scoobbs,

you are right, the main software repositories for many linux
distributions contain mostly outdated BaseX versions. Unfortunately, it
is not that easy to build correct packages for all distributions (as you
surely know, there are many Linux distributions around and there are
several relevant packing formats). Even more so, there is a not
straightforward path to follow to include software into a main
repository of a distribution, which takes time and effort.
We currently do not have this time, but we would always be happy if
users would volunteer to regularly include the latest versions at the
distribution of their choice, i.e. to include it into the official
repositories.

But all is not lost: Instead of downloading the jar file, just download
the zip distribution and extract the file. There you will find the
bin/basexgui (or bin/basex for the command-line version) which you can
simply execute and everything should be up and running.

Hope this helps,
Dirk

On 08/21/2015 12:03 AM, Scoobbs wrote:



 *
 ​ Looks like no one cares much for Ubuntu.

 I have version 7.7.2 installed, through the Ubuntu Software Center.

 It was just a matter of cliking here and there(actually no more than
 two clicks) and there I was.

 It even looks like BaseX realy works!!!

 ​
 ​ Well, now that I have decided to try to use it, there came a message
 saying a new version is available, namely 8.2.3.

 Alright, I agreed I should update it. But then I was taken to a site
 where something should be downloaded, in order for
 the installation to happen.

 A 'file' or 'container' with a .jar extension should be it, I thought.
 But, then again, there seemed to be no executable(or,
 easily executable) file/module/app, whatever, was found.

 So I concluded I am not as clever as most of the people building BaseX
 are. And, I ask:

 - Why is there not an actually easy way to install the application?

 - Is it so damn hard to build a thing like that?

 - Why is it so simple to implement applications included in the cited
 Ubuntu Software Center, for simple minded people like me, who can use
 effective tools like BaseX seems to be but are not capable of
 understanding(much less to use, and retain in memory, tens of cryptic
 commands?
 ​

 ​ Anyway, my intent is actually to ask someone(some good soul?) to
 update the Software Center so that one( I suppose many...) can
 fast-and-dirtly(sorry... this is just a way to show my frustration)
 use the tool.

 Thanks for any attention given to this request. And, if someone does
 anything like what I asked above, please just tell me where and what I
 must do. No need for replies nor attempts to teach me how to do it(I
 inclusively think maybe it is not that difficult to do as it is today,
 once one knows how to, but I am actually too old to learn new tricks...).
 ​

 ​ Cordially,

 ​
 Scoobbs
 ​ (who just thought he could build a simple database containing names,
 addresses, etc. about friends and family...)​
 ​ **​

 ==
 ​
 ==
 ​
 ​ ​
 =
 ​ PS: ** well, maybe, with some links to other variable attibutes of
 persons, like, courses attended, graduation data etc. etc.)​

 *

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] BaseX subcollections

2015-08-13 Thread Dirk Kirsten
Hello Tim,

I am not sure I understand your question completely. Basically every way
how you can add a document to a database you can specify a path, e.g.
using the XQuery database module or by using the CREATE document to
create a new database and initialize it. Is there anything specific you
are looking for?

Also, please not that BaseX 6.3.1 is _very_ outdated... I don't think
you can find much valuable information there except looking for the
history of BaseX.

Cheers
Dirk

On 08/12/2015 07:15 PM, Tim Thompson wrote:
 Hello,

 I see that I can create subcollections or paths within a database if I
 create the database then use the ADD TO command to add a resource at
 a specified path. Is this the only way to create hiearchical structure
 within a database? I couldn't find many details about this in the
 documentation.

 I see that the changelog for BaseX 6.3.1 includes,[ADD] REST: support
 for hierarchical collections added; details will follow, but I don't
 see anything about this in the wiki page for the REST module.

 Thanks in advance,
 Tim

 --
 Tim A. Thompson
 Metadata Librarian (Spanish/Portuguese Specialty)
 Princeton University Library


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] HTTP response and raising error()

2015-08-13 Thread Dirk Kirsten
Hello Marc,

you are correct. This is the advantage if you see the XQuery code
Christian writes, you will discover all the undocumented magic things.

But I added a little documentation at
http://docs.basex.org/wiki/RESTXQ#XQuery_Errors, so you all know how you
can return the mighty 418 status code :)

Cheers
Dirk

On 08/13/2015 04:33 PM, Marc van Grootel wrote:
 Ah, ok. Didn't know about the third argument. I didn't realize that an
 int as $error-object would be interpreted as returning that as status
 code. Is this documented? I mean how BaseX deals with the third
 argument? I couldn't find it. The spec leaves it open to
 implementations.

 --Marc

 On Thu, Aug 13, 2015 at 3:37 PM, Dirk Kirsten d...@basex.org wrote:
 Hi Marc,

 I agree, I think 500 would be more in line with the HTTP status code
 definitions.. It wasn't really an issue for us in our commercial projects
 ever (as we mostly send custom status code) and I guess this is why no one
 cared/noticed, but it would be cleaner to use 500 by default. By the way,
 you can define the status code easily by using  the third argument of the
 error function:

 fn:error( xs:QName('error'), message, 500)

 However, as it would be a breaking change it might be wise to delay the
 switch until BaseX 9. Or, of course, there are indeed some reasons why this
 is 400.

 Cheers
 Dirk

 On 08/13/2015 03:06 PM, Marc van Grootel wrote:

 Hi,

 Nothing major but I was wondering what the thinking was behind
 returning a 400 when fn:error is raised. Basically that says client,
 your mistake not mine where in most cases I guess a 500 would be more
 appropriate.

 Where is this decided (RESTXQ?) and is there an easy way to change the
 status when fn:error is used?

 Of course I can always catch at the highest level and then decide
 which HTTP status to return but I'm not sure if I want to wrap all
 REST calls in try / catch.


 --
 Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
 |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
 |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
 |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
 `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Using BaseX With oXygenXML: Validate XQuery 3.1 Syntax

2015-08-09 Thread Dirk Kirsten
Hi Eliot,

you should indeed bring this up at the oxygen mailing list, as we can do
nothing about it. This static validation error is clearly incorrect (but
your let should be lower case). But maybe someone on this list is an
experiences oxygen user as well...

Cheers
Dirk

On 08/08/2015 08:00 PM, Eliot Kimber wrote:
 I've started using oXygenXML rather than the DBA Web app to run my test
 queries (mostly so I can handle large result sets in the output).

 If I have a statement like:

 Let $foo as map(*) := map {}

 Oxygen reports a static validation error. If I remove the as clause,
 then it's happy.

 My question: is it possible to configure oXygenXML so it validates the 3.1
 expressions BaseX supports?

 I'm not sure if this an oXygenXML or a BaseX issue.

 Thanks,

 Eliot

 
 Eliot Kimber, Owner
 Contrext, LLC
 http://contrext.com




-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Running BaseX In A Docker Container?

2015-08-05 Thread Dirk Kirsten
Hello Eliot,

interesting question, we are tackling the problem ourself at the moment.
I created a BaseX docker HTTP image and we might want to include it in
streamline BaseX repo in some point in the future. You can find the repo
at https://github.com/dirkk/docker-basexhttp

For now, the docker image seems to work fine in one of our commercial
projects, where it is also used in conjunction with lots of other
(micro) services.
But if there are any Docker experts on our mailing list, I would be
happy for feedback or improvements, as we are also quite new to Docker
and I am not at all a Docker expert...

Cheers,
Dirk

On 08/05/2015 03:15 PM, Eliot Kimber wrote:
 As part of my DITA For Small Teams project we're setting up a set of
 coordinated Docker containers to manage the various components (git
 server, Jenkins server, BaseX server). We're setting up our own custom
 containers so that they are appropriately pre-configured.

 In the case of BaseX that means configured with the DFST Web app and
 supporting modules, configuration details, etc.

 Just curious if anyone has experience putting BaseX in a container and if
 there's anything we should look out for or anything we can contribute back
 out of this effort.

 Cheers,

 E.

 
 Eliot Kimber, Owner
 Contrext, LLC
 http://contrext.com




-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] annotations in function-declarations

2015-07-24 Thread Dirk Kirsten
Hi Rob,

just to clarify: Christian is very much around, I just try to answer as
much as I can here, so he as our mastermind has more time to implement
even more awesome features into BaseX and implement the latest XQuery
spec for you all to enjoy ;)

Cheers
Dirk

On 07/24/2015 08:03 AM, Rob Stapper wrote:

 Hello Dirk,

  

 Thanx for your reply. I addressed the question  to you because you’re
 the one mostly responding lately so I guessed Christian is on Holliday J

 My conclusion could indeed be incorrect, it probably is. Java is a
 good reference I think, it is pretty flexible. So that’s no option.

 I want to make something generic that even in the underlying Java
 isn’t generic. Maybe not such a good idea after all.

  

 Muchly appreciating your answer,

 Rob

  

 PS. I get your point concerning x-query talk.

 *Van:*Dirk Kirsten [mailto:d...@basex.org]
 *Verzonden:* donderdag 23 juli 2015 19:10
 *Aan:* Rob Stapper
 *CC:* BaseX
 *Onderwerp:* Re: [basex-talk] annotations in function-declarations

  

 Hello Rob,

 umm, I don't know why you mention me as I don't have any specific
 knowledge about annotations. But as I read it now I try to answer it
 anyways, but it sure would be nice if Christian would answer this as
 well, having much more knowledge about the topic than I ever will.

 I don't think your proposal is feasible. With using a variable value
 one would not be able to create the function at compile time (as the
 value could be different for different calls). Also, I think your
 conclusion in your example with the inline function is incorrect, as
 the function can still be created during compile time. For your
 proposal to work the function would have to be created during run time
 and I don't think this is a good idea.

 Also, I didn't complete understand your use case and why you can't
 simply use some function argument for this.

 I would also like to add that if you e.g., take a look at java
 annotations you will also see that it is only passible to use constant
 values as variables to be able to decide at compile time. I am not
 aware of any language that does allow this.

 By the way, in general it is a good idea to make us aware of
 dicussions that occur on the x-query talk ML and you specificly want
 us to get active. Personally, I don't read the ML very much anymore,
 as it was flooded with the same meta-discussion all the time recently
 and I got fed up quite a bit.

 Cheers,
 Dirk

 On 07/23/2015 05:41 PM, Rob Stapper wrote:

 Hi, I guess, Dirk,

  

 See the attached mail-threat, probably already noticed on talk@xquery.

  

 Is it possible that you do a little feasibility-study on the
 basex-implementation for my request?

  

 Thanx in advance,

 Rob Stapper

  

 

 Afbeelding verwijderd door afzender. Avast logo
 https://www.avast.com/antivirus

   

 Dit e-mailbericht is gecontroleerd op virussen met Avast
 antivirussoftware.
 www.avast.com https://www.avast.com/antivirus

  



 -- 
 Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
 |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
 |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
 |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
 `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22


 
 Avast logo https://www.avast.com/antivirus  

 Dit e-mailbericht is gecontroleerd op virussen met Avast
 antivirussoftware.
 www.avast.com https://www.avast.com/antivirus



-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] BASEX Help

2015-07-24 Thread Dirk Kirsten
Hello,

please make sure to always cc the mailing list, as we can't provide
personalized support for free, but we try to supports as much as
possible on our mailing list, but others should benefit from it as well.

However, I have to say that I have the feeling you lack a basic
understand of Java and you might be better of learning Java fundamentals
first. Also, given that you said you are still in school you might want
to ask your lecturer or a TA to give you hands-on help.
Having said that, you simply have to do a
new Check(mydatabase).execute(context);
with context holding a Context object.

Please take a look at the source code example I linked to in the last
mail, it really follows the exact same principle.

Cheers
Dirk

On 07/24/2015 09:29 AM, Yassine Hamdouni wrote:
 hi Dirk ,
  
 can you give me a sample of Check() in basex because I ue it for
 checking the existence the databaseX but i don't now how use it .
  
 new Check (C:\\Program Files (x86)\\BaseX\\data\\nomDeLaBaseDeDonnee);
  
 Regards

 2015-07-23 16:12 GMT+02:00 Dirk Kirsten d...@basex.org
 mailto:d...@basex.org:

 Hello,

 please be much more specific what you want to do and what does not
 work.
 That your tutor does not agree is not a proper problem description
 - Why
 does he not agree, what does not work as expected?

 However, I seriously doubt you ever attempted to run this code sample,
 so this should be the first thing to do. If you do, you should
 notice at
 least compiler warnings as for example your statement final Context
 context = null; is not really useful as it initializes the variables
 context with null and can not be changed. So your next usage of this
 variable will fail. Also, you always have to execute database commands
 against a database context.
 Please take a look at our examples, e.g. at
 
 https://github.com/BaseXdb/basex/blob/master/basex-examples/src/main/java/org/basex/examples/local/CreateCollection.java

 Cheers,
 Dirk

 On 07/23/2015 01:52 PM, Yassine Hamdouni wrote:
  hello ,
 
  I'm studying engineering school, I have to make a java method that
  allows to import the xml file, and put in a database so it ca not
  exist creates it, and after you optimize,
  I do this code, but my placement tutor does not agree, is that
 you can
  help me please.
 
  public void importerImpl(File dossierContenantLesXmls, String
  nomDeLaBaseDeDonnee, boolean ecraserDb) {
 
  final Context context = null;
Parser parser = null;
   File[] listefichierXml =
 dossierContenantLesXmls.listFiles();
 
 /*tester si la  base de donnée exste on l'ouvre sinon
 on la
  crée
   pour le test d'existence il y a ausi cette fonction à
  voir avec Bruno
   con.getDatabaseConnection(nomDeLaBaseDeDonnee);
 */
 
 System.out.println(-- opens an existing
  database or creates a new one-- );
if(context.soptions.dbexists(nomDeLaBaseDeDonnee)) {
 new Open
  (nomDeLaBaseDeDonnee);
}else {
try {
Data data = CreateDB.create( nomDeLaBaseDeDonnee,
  parser, context, null);
new Open (nomDeLaBaseDeDonnee);
} catch (IOException ex)
  {
  ex.getCause();
 }
  }
  // parcourir une liste de fichier Xml puis ajouter
 chaque
  fichier a  basex
for (int i=0;i=listefichierXml.length;i++){
new Add(listefichierXml[i].getAbsolutePath());
}
   new Optimize();
   context.close();
  }
  }
 
 
 
 
 
  --
  cordialement
 
  HAMDOUNI Yassine
 

 --
 Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
 |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
 |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
 |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
 `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22




 -- 
 cordialement 

 HAMDOUNI Yassine 


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Merging databases?

2015-07-24 Thread Dirk Kirsten
Hello,

I would be interested to know why you want to do that? I could imagine
this being relevant when restructuring/refactoring your data, but given
that you mention your design, it sounds like it is a recurring
occurence. I currently can't imagine why you want to do that, given that
you can access as many databases as you want using a single XQuery.

Cheers
Dirk

On 07/24/2015 09:40 PM, Eliot Kimber wrote:
 If there's to better way you should be able to simply copy the docs
 without first exporting them:


 For $dbname in $dbNames
 Return 
  Let $docs := collection($dbname)
  For $doc in $docs
  db:add($newDbName, $doc, $local:makeNewDocUrl($doc))

 Or something close to that

 Cheers,

 Eliot

 
 Eliot Kimber, Owner
 Contrext, LLC
 http://contrext.com




 On 7/24/15, 2:30 PM, Amanda Galtman
 basex-talk-boun...@mailman.uni-konstanz.de on behalf of
 amanda.galt...@mathworks.com wrote:

 Hi,

 Is there a simple, fast way to merge databases? For example, suppose I
 have 200 databases, each with 5 XML documents, and the document paths are
 unique across all the databases. I want to produce a database containing
 all 1000 documents.

 I looked in the Database Module wiki and nothing jumped out as being
 uniquely tailored for this task. I¹m sure there is an ad hoc way to do it
 by looping over the documents in the databases, exporting them, and
 adding them to the new database.
 But if that takes the same amount of time as building the 200 databases
 in the first place, I should change other things about my design to avoid
 the need to merge databases.

 Thanks,
 Amanda



-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] BASEX Help

2015-07-23 Thread Dirk Kirsten
Hello,

please be much more specific what you want to do and what does not work.
That your tutor does not agree is not a proper problem description - Why
does he not agree, what does not work as expected?

However, I seriously doubt you ever attempted to run this code sample,
so this should be the first thing to do. If you do, you should notice at
least compiler warnings as for example your statement final Context
context = null; is not really useful as it initializes the variables
context with null and can not be changed. So your next usage of this
variable will fail. Also, you always have to execute database commands
against a database context.
Please take a look at our examples, e.g. at
https://github.com/BaseXdb/basex/blob/master/basex-examples/src/main/java/org/basex/examples/local/CreateCollection.java

Cheers,
Dirk

On 07/23/2015 01:52 PM, Yassine Hamdouni wrote:
 hello ,

 I'm studying engineering school, I have to make a java method that
 allows to import the xml file, and put in a database so it ca not
 exist creates it, and after you optimize,
 I do this code, but my placement tutor does not agree, is that you can
 help me please.

 public void importerImpl(File dossierContenantLesXmls, String
 nomDeLaBaseDeDonnee, boolean ecraserDb) {
  
 final Context context = null;
   Parser parser = null;
  File[] listefichierXml = dossierContenantLesXmls.listFiles();

/*tester si la  base de donnée exste on l'ouvre sinon on la
 crée
  pour le test d'existence il y a ausi cette fonction à
 voir avec Bruno
  con.getDatabaseConnection(nomDeLaBaseDeDonnee);
*/

System.out.println(-- opens an existing
 database or creates a new one-- );
   if(context.soptions.dbexists(nomDeLaBaseDeDonnee)) {  
new Open
 (nomDeLaBaseDeDonnee);
   }else {
   try {
   Data data = CreateDB.create( nomDeLaBaseDeDonnee,
 parser, context, null);
   new Open (nomDeLaBaseDeDonnee);
   } catch (IOException ex)
 {   
 ex.getCause();
}
 }
 // parcourir une liste de fichier Xml puis ajouter chaque
 fichier a  basex  
   for (int i=0;i=listefichierXml.length;i++){
   new Add(listefichierXml[i].getAbsolutePath()); 
   }
  new Optimize();
  context.close();
 }
 }

  
  


 -- 
 cordialement 

 HAMDOUNI Yassine 


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Option Parallel Verständnisfrage

2015-07-23 Thread Dirk Kirsten
Hello Dennis,

could you also send us the query (or a SSCCE) as well? In many cases,
queries are not bound by the CPU, but are rather IO-bound. In this case,
distributing the load to multiple cores might in fact decrease
performance, as the disk might have to be accessed at different random
locations. Even when using an SSD, this might slow down the execution
considerably. Also, the application has to do context swichting to use a
different hread, so this decreases performance as well and might
outweight the benfit of parallelized computation. It very much depends
on your quers. You can take a look e.g. by using a tool like visualvm
and analyze where most of the time during execution is spend. Also, you
should update your BaseX version, 7.7 is outdated for quite some time
now and we have done major improvements since then.

I am too lazy to write in German as well, I hope thats fine.

Aber trotzdem die besten Grüße an die andere Seite des Bodensees wünschend,
Dirk


On 07/23/2015 02:12 PM, Dennis Wiest wrote:

 Hallo,

  

 ich habe eine Verständnisfrage bezüglich  der Option „Parallel“.

 Ich wollte mir einen Überblick über die Geschwindigkeit von BaseX
 machen bezüglich mehrerer Benutzeranfragen.

  

 Ich verwende Basex 7.7.

 Ich habe mir ein Java Programm mit Multithreads geschrieben, welches
 das ganze simuliert.

 Das Script funktioniert soweit auch und es werden mir im BaseX die
 Session für jeden Benutzer angezeigt.

  

 Als erstes hab ich Parallel auf 20 gesetzt.

 Mir ist dabei aufgefallen das es pro Benutzer immer langsamer wird und
 die CPU-Auslastung nicht wirklich hoch ist. Wird das ganze gar nicht
 Parallel abgearbeitet ? Verteilt BaseX die Last nicht auf die CPU´s??

  

 Danach hab ich Parallel auf 1 gesetzt.

 Das Ergebnis ist schneller als Parallel 20, das dürfte bei einer
 sequenziellen Abarbeitung nicht sein oder ??

  

 Das ganze System läuft auf einem HP Server mit 64 GB Arbeitsspeicher
 einer PCI SSD Festplatte und einem Intel Xeon E5-2690 8-Core 2.90 GHz
 Prozessor.

  

 Könnt ihr mir da vielleicht eine Erklärung liefern ?

  

 Ich hab das ganze nochmal in Englisch geschrieben.

  

 Vielen dank

  

 Gruß Dennis Wiest

  

 Hello There,

 I have a question concerning the understanding of parallel option.
 I wanted to make an overview of the speed of BaseX regarding several
 user requests.

 I use Basex 7.7.
 I have a Java program written with multi-threads, to simulating this.
 The script works well so far and the session for each user are
 displayed in BaseX.

 First I set “parallel” to 20.
 I've noticed that it is getting slower for each user and the CPU
 utilization is not really high. Will not parallel processed?
 Distributes the load on the CPU not BaseX ??

 Then I got the same and set “parallel” to 1.
 The result is faster than parallel 20, that should not be in a
 sequential processing or ??

 The whole system runs on an HP server with 64GB of RAM PCI SSD hard
 drive and an Intel Xeon E5-2690 8-core 2.90 GHz processor.

 Can you provide an explanation as me, maybe?

 I have the whole again written in English.

 many thanks

 Greeting Dennis Wiest


 
 Avitech GmbH
 Principal Office: Bahnhofplatz 1 | 88045 Friedrichshafen | Germany
 Court Registration: Amtsgericht Ulm | HRB 728293
 Geschäftsführer/Managing Director: Antonio Maria Gonzalez Gorostiza
 VAT No.: DE223719716
 http://avitech.aero

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] annotations in function-declarations

2015-07-23 Thread Dirk Kirsten
Hello Rob,

umm, I don't know why you mention me as I don't have any specific
knowledge about annotations. But as I read it now I try to answer it
anyways, but it sure would be nice if Christian would answer this as
well, having much more knowledge about the topic than I ever will.

I don't think your proposal is feasible. With using a variable value one
would not be able to create the function at compile time (as the value
could be different for different calls). Also, I think your conclusion
in your example with the inline function is incorrect, as the function
can still be created during compile time. For your proposal to work the
function would have to be created during run time and I don't think this
is a good idea.

Also, I didn't complete understand your use case and why you can't
simply use some function argument for this.

I would also like to add that if you e.g., take a look at java
annotations you will also see that it is only passible to use constant
values as variables to be able to decide at compile time. I am not aware
of any language that does allow this.

By the way, in general it is a good idea to make us aware of dicussions
that occur on the x-query talk ML and you specificly want us to get
active. Personally, I don't read the ML very much anymore, as it was
flooded with the same meta-discussion all the time recently and I got
fed up quite a bit.

Cheers,
Dirk

On 07/23/2015 05:41 PM, Rob Stapper wrote:

 Hi, I guess, Dirk,

  

 See the attached mail-threat, probably already noticed on talk@xquery.

  

 Is it possible that you do a little feasibility-study on the
 basex-implementation for my request?

  

 Thanx in advance,

 Rob Stapper



 
 Avast logo https://www.avast.com/antivirus  

 Dit e-mailbericht is gecontroleerd op virussen met Avast
 antivirussoftware.
 www.avast.com https://www.avast.com/antivirus



-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Any Way to Create A Database And Commit To It From REST Service?

2015-07-13 Thread Dirk Kirsten
Hello Eliot,

You can add the documents directly using the db:create() function, thus
being able to create and initialize the database. If you have multiple
documents to add it can be done like the following example:

  db:create('new-database', (some-data/, more-data/),
(somedata.xml, moredata.xml))

Hope this helps,
Dirk

On 07/11/2015 07:38 PM, Eliot Kimber wrote:
 In my link management application I'm trying to refactor my code to move
 my link management metadata out of the content database (the one that
 otherwise has the user's XML docs) and into a separate database.

 The problem I'm running into is that because db:create() is put last on
 the pending updates list, you can't do

 return (
 db:create('new-database'),
 db:add('new-database', 'some-data/'))

 There doesn't seem to be a direct way through the RESTXQ-managed
 application to create the database since updating functions don't return
 anything (so I can't, for example, have the root page handler ensure that
 the database is there simply by calling an XQuery function to initial it).

 I think the only solutions are:

 1. Have the database creation managed outside the REST application (e.g.,
 in my git hooks, which are where the content database creation is done)

 2. Use the redirect technique so that, for example, the root page is
 handled by an updating function that does the database initialization and
 then returns a redirect to the real root page handler.

 Have I missed an option?

 Thanks,

 Eliot

 
 Eliot Kimber, Owner
 Contrext, LLC
 http://contrext.com




-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Fwd: Bug?

2015-07-13 Thread Dirk Kirsten
) at
 org.basex.query.expr.If.value(If.java:133) at
 org.basex.query.expr.gflwor.GFLWOR.value(GFLWOR.java:72) at
 org.basex.query.expr.TypeCheck.value(TypeCheck.java:127) at
 org.basex.query.QueryContext.value(QueryContext.java:421) at
 org.basex.query.expr.If.value(If.java:133) at
 org.basex.query.QueryContext.value(QueryContext.java:421) at
 org.basex.query.func.StaticFunc.invValue(StaticFunc.java:192) at
 org.basex.query.func.FuncCall.invoke(FuncCall.java:87) at
 org.basex.query.func.FuncCall.value(FuncCall.java:60) at
 org.basex.query.func.FuncCall.iter(FuncCall.java:66) at
 org.basex.query.MainModule.iter(MainModule.java:110) at
 org.basex.query.QueryContext.iter(QueryContext.java:349) at
 org.basex.http.restxq.RestXqResponse.create(RestXqResponse.java:55) at
 org.basex.http.restxq.RestXqModule.process(RestXqModule.java:101) at
 org.basex.http.restxq.RestXqFunction.process(RestXqFunction.java:109)
 at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:44) at
 org.basex.http.BaseXServlet.service(BaseXServlet.java:64) at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
 at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
 at
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
 at
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
 at
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
 at
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
 at
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at
 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Unknown Source)

 _Sincerely, Sergey Chesnokov.




 

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] RESTXQ: function loading

2015-07-09 Thread Dirk Kirsten
Bonjour Jérôme,

I am having trouble to replicate the issue. I just tried the
inspect:functions() call from an xqm module and I am having no trouble
seeing the functions from another XQuery module. Did you import the module?
Could you maybe send a SSCCE (http://sscce.org/), so that we can easily
see the problem ourself?

Cheers
Dirk

On 07/09/2015 03:46 PM, Jérôme Chauveau wrote:
 Hi,

 i'd like to execute a function (which I wrote in an .xqm module) with
 an fn:function-lookup call.

 This function has no %rest:path annotation and seems to be unavailable
 from the current context function list (I inpected it with an
 inspect:context//function call).

 Is there a way to force its loading?

 I am currently working with the last BaseX8.2.2 war version.

 Thanks.

 Regards,

 Jérôme


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Execution problem

2015-07-02 Thread Dirk Kirsten
Hi Samby,

the query is behaving correctly. You have to escape  (with lt;) as it signals 
the beginning of an element. On the other hand you should escape  (with gt;), 
but it is not strictly required.

Cheers,
Dirk

On 07/02/2015 10:40 AM, IrisDeveloper development wrote:
 Hello,


 I am executing following query in basex 8.2

 let $a := aif a  0 {sum((1,2,3))}/a
 return $a

 o/p : aif a gt; 0 6/a

 but when I am executing

 let $a := aif a  0 {sum((1,2,3))}/a
 return $a

 it gives me a  error Expecting element name , '' found.

 Query works for '' but not with ''.


 Thanks
 Samby


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] performance of preceding/following axis

2015-06-18 Thread Dirk Kirsten
Hello Daniel,

I don't have much time right now, but maybe a few pointers to get you started. 
I didn't test any of this, so take it with a grain of salt.

However, I guess your subsequence solution is not performing optimal, as I 
would guess that there really is a new sequence created. So for 50.000 matches 
you have to create 100.000 new sequences, which is kind of costly. Instead I 
would recommend using position() to compare the element positions instead and 
get your window this way. This can operate directly on your data.

Also, did you know that there is a window expression in XQuery 3 (see 
http://www.w3.org/TR/xquery-30/#id-windows for more)? Looks like an optimal use 
case here and should also perform much better than subsequences.

Hope this helps,
Dirk

On 06/18/2015 12:39 PM, Schopper, Daniel wrote:
 Hi,
 I'm trying to use BaseX for linguistic queries on a TEI document containing 
 annotated tokens (i.e. tei:w-elements with attributes). I'm specifically 
 interested in distance queries that allow to search for combinations of token 
 features within a given window (e.g. all nouns that have an adjective ending 
 with 'lein' within a distance of 3.) Theoretically, this is rather easy to 
 formulate with an XPath or XQuery expression, but performance is poor when 
 the dataset gets a bit larger (in my case, I have a total of 190.000 tokens 
 in my test document, attribute and text indexes created).

 This is what I essentially try to do as a simple XPath:

 declare default element namespace  http://www.tei-c.org/ns/1.0;;
 //w[@type = NN][(subsequence(preceding::w, 1, 3), subsequence(following::w, 
 1, 3))/@type = ADJA]

 Since tokens may be interwoven with markup, I have to use preceding::* or 
 following::*

 A simple XQuery returning all matches including their context would look like 
 this:

 declare default element namespace  http://www.tei-c.org/ns/1.0;;

 let $window := 3
 let $matches := //w[@type = NN]
 return

 for $m in $matches
 let $pre := subsequence($m/preceding-sibling::w, 1, $window)
 let $next := subsequence($m/following-sibling::w, 1, $window)
 return
   if (($pre,$next)[@type = ADJA])
   then
 conc
   pre{$pre}/pre
   match{$m}/match
   next{$next}/next
 /conc
   else ()

 With $matches being a sequence of ca. 50.000 elements, a FLOWR is a bit too 
 costly, I fear; limiting $matches to ~ 1.000 items performs within 5600ms 
 (returning 154 items), but performance decreases rapidly after that (not to 
 speak about setting a larger distance) .
 So, my question is: Is there a way to improve performance on operations like 
 these (without resorting to changing the input document)?

 I'd be glad to provide my dataset off list, if this helps.

 Thanks,
 Daniel



-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] db:event

2015-05-26 Thread Dirk Kirsten
Hello Marco,

I am sure Christian already has more information, but we discussed the issue 
some time ago here: https://github.com/BaseXdb/basex/issues/1082
I am sure your input is very much appreciated if you look for certain features 
in the new trigger architecture

Cheers
Dirk

On 05/26/2015 12:39 PM, Marco Lettere wrote:
 Hi Christian,
 I read that starting with 8.2 the db:event API has been removed and will
 be replaced by triggers.
 Since we wanted to start using db:event in order to chain activities in
 our workflows in a loosely coupled way, I'd like to know when the new
 feature based on triggers will be available.
 Are there any hints on how the API will possibly look?
 Will it be possible to fire explicit applicative events not only based
 on db activities?
 Thanks.
 BR,
 Marco.

-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Installing BaseX in Debian Wheezy

2015-05-22 Thread Dirk Kirsten
Hi Javier,

you can find version 8.1.1 (as well as 7.9) in testing (
https://packages.debian.org/source/testing/basex), 7.9 should be in stable (
https://packages.debian.org/source/stable/basex).

Please note that due to the package management the versions in the
repositories will always lack behind our own releases. We just released
version 8.2., so you might simply want to start with this. Simply download
the zip distribution and start bin/basexgui (or bin/basex for CLI only) -
it really does not require much setting up.

Cheers
Dirk

On Fri, May 22, 2015 at 3:19 PM, Javier Couto javier.couto...@gmail.com
wrote:

 Hi,

 Sorry if this is too basic but I can’t find specific information to
 resolve it.

 I am trying to install BaseX version 7.9 in Debian (wheezy) using apt-get
 or aptitude but the only version available seems to be the 7.6? Is this
 correct?

 Thank you in advance,

 Javier




-- 
Dirk Kirsten, BaseX GmbH, http://basex.org
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22


Re: [basex-talk] Installing an older version of BaseX on a Mac laptop

2015-05-21 Thread Dirk Kirsten
Hello Christine,

I can't really imagine why the homebrew formula should be gone (according
to http://braumeister.org/formula/basex there are several versions
available), but I am not a mac user myself, so I can't check.

However, the simplest way imho for all operating systems to start BaseX is
to download the zip distribution at
http://basex.org/products/download/all-downloads/ and to simply start
bin/basexgui (or in case of windows bin/basexgui.bat) - This should be all
it takes to start BaseX! No installation or setup neccessary, you should be
good to go.

Cheers
Dirk



On Thu, May 21, 2015 at 7:05 PM, Schwartz, Christine 
christine.schwa...@ptsem.edu wrote:

  Hi,



 I’m new to BaseX and currently preparing a training session teaching
 XQuery and using BaseX as the programming environment.



 I’m setting up step-by-step instructions for the attendees and have run
 into trouble with the Mac installation using Homebrew and BaseX. The
 Homebrew formula that was available yesterday appears to be gone.



 Please advise as to how to simply install BaseX on a Mac, as the session
 is for non-programmers and I want to keep the instructions simple.



 Thanks,



 Chris





 Christine Schwartz

 Metadata Librarian and XML Database Administrator

 Princeton Theological Seminary Library






-- 
Dirk Kirsten, BaseX GmbH, http://basex.org
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22


Re: [basex-talk] Create DB from large XML extraction without root element?

2015-05-19 Thread Dirk Kirsten
Hello Constantine,

as this is not a valid XML document there is no way to add this to BaseX.
You could write an XQuery, which reads in the document as a text file and
chops the file into valid XML documents (of course you could also do this
with some external line-processing tool like sed).

Of course, as you mentioned, adding a root node is the easiest option.

Cheers
Dirk

On Tue, May 19, 2015 at 11:32 AM, Hondros, Constantine (ELS-AMS) 
c.hond...@elsevier.com wrote:

  Hello all,

 I have a huge extraction of XML documents in a single file, without a root
 element, something along these lines:



 a

  b/

 /a

 a

  b/

 /a

 …





 Other than by editing it to add a root element, is there a clever way of
 creating a Basex DB from this?



 Thanks for any pointers,

 C.

 --

 Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The
 Netherlands, Registration No. 33156677, Registered in The Netherlands.




-- 
Dirk Kirsten, BaseX GmbH, http://basex.org
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22


Re: [basex-talk] Open database outside DBPATH

2015-05-18 Thread Dirk Kirsten
Hi Ketill,

I don't fully understand your requirement. Why don't you simply add/replace
the documents (using the database commands or within XQuery db:add(...) or
db:replace(...)). This, of course, reads files from the file system to add
them to the database.

It looks much more suitable for the use case you describe, but maybe I am
missing something.

Cheers
Dirk

On Mon, May 18, 2015 at 10:35 AM, Ketill Fenne ketill.fe...@gmail.com
wrote:

 Ok, thanks!

 My requirement is that in a locally installed product that uses BaseX to
 store content I need to read a database(s) containing new/changed documents
 from (preferrably) an upgrade/ - folder and add/replace documents in the
 existing database(s) in the DBPATH - dir.
 I guess I'll move the database into DBPATH, install the updates, and then
 drop the database(s) containing the upgrades.

 Ketill Fenne

 On Mon, May 18, 2015 at 10:25 AM, Christian Grün 
 christian.gr...@gmail.com wrote:

 Hi Ketill,

  Maybe this has been answered before, but is it possible to open and
 read a
  database located outside DBPATH?

 Sorry, no. Currently, what you can do is..

 * set DBPATH via system properties before starting BaseX [1],
 * create symbolic links in your database directory, or
 * copy your databases in the db directory..

 But I'm not sure if any of these options meets your requirements?
 Christian

 [1] http://docs.basex.org/wiki/Options





-- 
Dirk Kirsten, BaseX GmbH, http://basex.org
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
|   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22


Re: [basex-talk] xquery of attributes

2015-05-07 Thread Dirk Kirsten
Hello Florent,

first of all, it doesn't matter here whether you use XQuery in a web context or 
not - It would throw the same error even without using RESTXQ.

The problem with your first error was that you selected multiple attributes and 
constructed and element with this - As an XML element can not have multiple 
attributes with the same name, this will not work. Thats why it does work with 
elements, because each element can have multiple child elements with the same 
name. In your proposed solution, string() converts the attributes to plain 
strings, and of course your element can hav a text child.

So your solution is very much ok, but what the best way is enterily depends 
on what you want as output. If the current solution gives you your desired 
ouput, then I see no harm in using this one. However, if it is not and you want 
more help, it would be nice if you could provide a small example output on what 
you want to get back as result.

Cheers
Dirk
On 05/07/2015 03:38 AM, Florent Gallaire wrote:
 I answer to myself :
 db:open('factbook')//city/@name/string()
 will works fine.

 Still, is there a best way ? Is there some problems with that ? Is the
 element way better for xquery web usage ?

 Cheers

 Florent

 On Thu, May 7, 2015 at 2:18 AM, Florent Gallaire fgalla...@gmail.com wrote:
  In the RESTXQ documentation there is this example which works fine :
 
  declare
%rest:path(cities)
%output:method(json)
%output:json(format=jsonml)
function page:cities()
  {
element cities {
  db:open('factbook')//city/name
}
  };
 
  If I have the same factbook db but with name as attribute and not as
  element, with the only change in the code the xquery request
  db:open('factbook')//city/@name I will have the error message:
  [XQDY0025] Duplicate attribute 'name'.
 
  That's ok, but what is the right way in xquery to easily use multiple
  attributes as return value of request.
 
  Is the right way to prefer elements to attributes ?
 
  Cheers
 
  Florent
 
 
 
  --
  FLOSS Engineer  Lawyer




-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Base-X basics :-}

2015-05-06 Thread Dirk Kirsten
Hello Niels,

welcome to the wonderfully weird world of XQuery and BaseX :)

We do have a quite extensive help at http://docs.basex.org/wiki/Main_Page, 
which should give you some pointers.

At http://docs.basex.org/wiki/Getting_Started you can find some introductions 
by other people, particularly BaseX for Dummies by Paul Swennenhuis and BaseX 
Adventures by Neven Jovanovic might be helpful.

The wikibook might still be helpful. Yes, it is written using eXist, but most 
of the code is plain XQuery. However, it is a bit outdated as it does not use 
more advanced 3.0 features. For most functions eXists provides there are 
similar functions in BaseX.

For general XQuery learning the book by Priscilla Walmsley is still very 
useful. Also, the new Book about eXist is good and many parts are just generic 
XQuery.

Well, and from personal experience I can recommend enrolling into the 
University of Konstanz and taking Christians BaseX- and XML lecture ;)

Cheers,
Dirk

On 05/06/2015 02:25 PM, Niels Grundtvig Nielsen wrote:
 I've used ColdFusion and (reluctantly) php with MySQL, so I have some idea
 about combining database query with html tags to get formatted output … but
 I'd welcome a pointer to a tutorial about doing the same thing with Base-X

 Also, what would you recommend as an introduction to xQuery? w3schools … I
 seem to remember this was a bit brief, and this afternoon I can't get it to
 load anyway; wikiBooks on xQuery already incudes exist-DB specific code in
 the second of its Beginning examples.

 Thanks in advance!


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] BaseX 8.1 cannot be deployed in a resin server

2015-04-01 Thread Dirk Kirsten
Hi George,

yes, I think there is something wrong with the Servlet. We tried to fix some 
things to get BaseX to close more gracefully on Tomcat, but seems like 
something is going wrong now. On Tomcat I can't deploy the 8.1. WAR file 
anymore, it fails with SEVERE: Error listenerStart

I guess Christian is going to tackle this issue next week when hes back from 
his vacation.

Cheers
Dirk

On 04/01/2015 03:01 PM, George Karakatsiotis wrote:
 Hi,
 While I have been able to deploy basex7.9+ to a resin web server, Basex 8.1
 fails with a Custom bean class 'org.basex.http.ServletListener' is
 abstract.  Bean classes must be public, concrete, and have a zero-argument
 constructor. error message. Is there a reason why
 org.basex.http.ServletListener is abstract? I don't see any abstract
 methods and no other class is extending it.

 Thank you for your time,
 George Karakatsiotis


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Used memory value

2015-03-31 Thread Dirk Kirsten
Hi Joseph,

When did you see this 218% usage of your CPU? I can replicate the behaviour 
when I open the said memory dialog. In this case (i.e. if the memory dialog 
window is open) I have also around ~200% CPU usage on my fedora machine. 
However, closing the window leads to a very normal CPU usage. So I would 
conclude the high CPU usage is simply be calculating the RAM values and 
updating the GUI all the time.

However if you encouter this CPU usage without this memory dialog open I would 
say we should look into this, as it would be a non-acceptable CPU usage.

Cheers
Dirk

On 03/30/2015 09:24 PM, Joseph wrote:
 Yes, I mean the value displayed in that dialog box. On my machine (Mac OS X
 10.9.5), the CPU used by BaseX 8.1 turns out to be 218%, even when I am not
 querying anything (so I guess the memory problem causes this). If I use
 BaseX 7.9, everything is fine. So now I am using an older version of BaseX.

 I can also say that the same problem happens on another mac (OS X Yosemite
 10.10.2). Thanks

 2015-03-28 14:07 GMT+01:00 Christian Grün christian.gr...@gmail.com:

  Hi Joseph,
 
  When I open Basex 8.3 GUI, the value of the used memory keeps growing
  up/changing fast, even though I do not do anything. Since this does not
  happen with Basex 7.9, is this due to Java? (I run Java 1.8.X)
 
  I noticed that the memory dialog window (which is shown if you click
  on the memory display in the lower right corner of the GUI) is updated
  nonstop. Maybe you are you refering to this (unexpected) behavior? I
  have just added a GitHub for this [1].
 
  If you refer to memory usage in generally, all I can say is that the
  memory consumption, which is indicated by a java instance, is not
  necessarily the amount of memory that's currently used by the JVM. I
  have also observed that the behavior differs with each Java version.
 
  I didn't notice any unexpected behavior by myself, but feel free to
  give me an update if you should encounter things like out of memory.
  You could e.g. limit available memory in the basexgui script to e.g.
  64m, using the -Xmx64m flag, and observe if the GUI can cope with
  that.
 
  Best,
  Christian
 
  [1] https://github.com/BaseXdb/basex/issues/1118
 
 
 
  Thanks,
  Joseph
 


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Comparing NxDs

2015-03-03 Thread Dirk Kirsten
Hi Mansi,

adding to the excellent advice given by Christian and Marco I would like to add 
two points:

1. I guess you could turn the question around: Why would you store your XML 
data in a relational database? To me it feels the most natural thing to store 
XML (or in general hierarchical data) in an XML database like BaseX, to store 
JSON data in a json database like MongoDB and table-like data in a relational 
database like Oracle and DB2. Of course, there are also other technical reasons 
why you might want to use a more mature system like DB2, but also non-technical 
reasons, for example a deep knowledge of your employees with SQL.

2. Choosing a database system is not just a technical, but also a business 
decision. So one point for this to keep in mind: Systems like DB2 and Oracle 
aren't cheap, I am sure the folks at IBM and Oracle will tell you that. On the 
other hand, BaseX is open-source (but provides commercial support). Of course, 
there are also many other open-source dbms like Postgres.

Cheers
Dirk

On 03/01/2015 02:36 PM, Marco Lettere wrote:
 Hi Mansi,
 my 2 cents here are mainly that none of the RDBMS based solution deliver
 the full support of the complete stack of XML technologies to their
 complete power (XPath, XQuery 3.x, XSLT, XSD, eXPath , aso).
 As far as I remember you can hardly find HTTP server functionality with
 RestXQ support there too.
 As soon as you have to write an application or service of a respectable
 complexity you will nee all of those functionalities.
 Another point to use here, at least with BaseX, is the footprint of the
 application.
 I don't know how large DB2 is but for sure installing, managing and
 using PostgreSQL is several levels of complexity higher than using BaseX.
 Finally I also think that for implementing a really performing tree
 based database the relational technology is not suited and a proper
 datamodel is required but I don't have figures or demonstrations for
 that so I'm also very curious to see those performance comparison
 results! :-D
 Hope this helps somehow.
 Greetings,
 Marco.


 On 28/02/2015 12:11, Christian Grün wrote:
  Hi Mansi,
 
  No one answered so far, so there is probably no simple answer to your
  question.
 
  As you indicated, many relational DBMS (such as DB2 and PostgreSQL)
  provide support for XPath as well, but in most cases, the systems do
  not create additional index structures on top of the XML nodes to
  speed up querying. However, as the queries you presented on the
  mailing list are simple XPath expressions, there are probably not so
  many chances to benefit from values index structures anyway.
 
  If teams in your companies are trying DB2 and PostgreSQL anyway, I'll
  be looking forward to hearing more about their experiences. Commercial
  systems often disallow their users to publish performance results (and
  presenting them on the list is some way of publishing them), so you
  can also send them to me privately. If you go for PostgreSQL, this
  won't be a problem of course.
 
  Hope this helps,
  Christian
 


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] Xquery issue

2015-02-24 Thread Dirk Kirsten
Hello Rob,

well, it is interesting that the optimizer is optimizing away every second 
function call. However, the problem here seems to be introduced solely by 
prof:dump() and I actually can understand that optimizing this is more 
complicated. Not saying that it couldn't be optimized (Christian know far, far 
more about this than I do), but if remove thr prof:dump() the query is 
optimized to the query 16, which I guess can't be further optimized.

And seeing that prof functions are for profiling and debugging and are usually 
not used in production, I think this could be considered a very minor issue.

Cheers
Dirk

On 02/24/2015 12:43 PM, Rob Stapper wrote:
 Hi guys,

  

 While debugging a xquery-program I saw something strange behavior( to me
 anyway).

 I reproduced it in the attached xquery-snipped.

 Looking at the evaluation data in the query-info screen of the basexGUI
 after running the program, one can see that function $f($a) is evaluated
 more than ones.

 The result is ok but I wondered if this would reduce the performance.

  

 I'm running version 8.01 beta d13ddc7 in local GUI-mode.

  

 Regards,

  

 Rob Stapper



 ---
 Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
 http://www.avast.com


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



Re: [basex-talk] DBNode Not Overriding equals() and hashcode() method.

2015-02-24 Thread Dirk Kirsten
Hello Ankit,

I don't quite get the problem or what we are supposed to do. Why don't you 
simply write your own class extending DBNode, overwrite the methods and store 
these in a set?

Cheers
Dirk


On 02/24/2015 01:19 PM, ankit kumar wrote:
 Hi,

 I am trying to maintain a Set of DBNode Object But, it was not working
 properly because DBNode is not overriding the equals() and hashcode()
 methods. Due to this reason i am facing difficulty to maintain similar
 DBNode. Looking forward for help.



 Thanks  Regards
 Ankit Kumar


-- 
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
|-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
| Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
`-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22



  1   2   3   >