Re: [basex-talk] %unit:ignore broken since 8.0?

2015-03-31 Thread Lukas Kircher
Hi Marc,

sorry for the inconvenience - there have indeed been some changes to the
unit module in the recent past, that are not yet covered by the
documentation.
I assume unit:ignore is one of them (w/o checking the sources). Christian is
out of town at the moment, so it might take a week before we get back to
you.

Cheers,
Lukas

On Mon, Mar 30, 2015 at 10:14 PM, Marc van Grootel 
marc.van.groo...@gmail.com wrote:

 Hi,

 Could it be that %unit:ignore(message) is broken since 8.0.

 Whenever I use a message in the annotation my tests fail with this
 error message:

   error line=149 column=21 type=bxerr:BASX0006
   info%unit:ignore: 1 argument supplied./info
   /error

 When (mesage) is removed the test is ok.

 Documentation let's me believe %unit:ignore(message) is still supported.


 --Marc



Re: [basex-talk] %unit:ignore broken since 8.0?

2015-03-31 Thread Lukas Kircher

 behind it is. Being able to put a message there to indicate why the
 test was ignored is quite handy to have.


​I agree ...


Re: [basex-talk] Simple xQuery functions do not work as expected

2015-03-25 Thread Lukas Kircher
Hi Goetz,

I also had a quick try myself. It works without any problems on my setup
(without the 'compare' function) and gives me the following results:


*local:getLabel('_and', 'FR')  --  et*
*local:getLabel('_and')  --  und*

Setup:
*OS X 10.10*

*java version 1.8.0_25*
*BaseX 8.0.3 GUI*

You find the code as attachment ... does this help?

Cheers,
Lukas

On Tue, Mar 24, 2015 at 3:33 PM, Christian Grün christian.gr...@gmail.com
wrote:

 Dear Goetz,

 Thanks for your mail.

  The first function appears to work as expected. However, instead of
 “[@LG =
  $lang]” I had to use [compare(@LG, $lang) = 0]” – I don’t know why, but
  otherwise, it does not return any results.

 I tried the query, but I get a result in both cases, no matter if I
 use compare() or =. Did you refer to the first or second of your two
 local:getLabel functions? Could you possibly minimize the example even
 more?

 Thanks in advance,
 Christian


 
  On the other hand, using “[@label = $key]” on the same line worked.
 
 
 
  The second function does not return anything at all.
 
 
 
  The debug version of the latter shows that all the needed information is
 in
  place. Obviously, usage of the same variable name globally and locally is
  not an issue (I’ve tried it out).
 
 
 
  What’s wrong with the code? Is there an issue with the current version
  (8.0.3)? My installation runs on a Windows 8.1 machine.
 
 
 
  Some help is appreciated.
 
 
 
  Kind regards,
 
 
 
  Goetz



labels.xq
Description: Binary data


Re: [basex-talk] Concurrent handling of reads while ADDing a file

2015-03-05 Thread Lukas Kircher
Hi David,

this is maybe something we could append to the documentation that Christian
already
pointed you to.

As far as I get it, the concurrency management works single writer/multiple
reader.
If you are writing to database A all reads on said database are blocked
until modification
is finished. Other databases may still be readable, depending on whether
the compiler
can figure out if it is safe.

-- If you call db:add() on database A, you cannot read on database A. All
other dbs might
still be accessible. If you start another server process P2 you might run
into problems when
process P1 starts another update operation (because this one doesn't know
about P2's reads).

I hope this wraps it up correctly ...
Lukas


On Thu, Mar 5, 2015 at 1:55 PM, Christian Grün christian.gr...@gmail.com
wrote:

 Hi David,

 Thanks for your mail. If i get it right, you are adding a new XML file
 into a database, using the client/server architecture, and you'd like
 to read documents from another database, right? This shouldn't be a
 problem. What API are you working with (how do you add the new file)?

 Cheers,
 Christian

 PS: You are invited to also have a look into our Wiki article on
 transactions [1].

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


 On Thu, Mar 5, 2015 at 1:31 PM, David Mathei david.mat...@gmail.com
 wrote:
  Hello BaseX Team,
 
  I am loading a big file into BaseX (2.1G) and try to understand the
 handling
  of concurrent reads during that process. The size does only matter in so
  far, as loading seems to block reading for an extended amount of time.
 
  I observe that I can not read the collection I'm loading into nor any
 other
  collection under the same server. When I use another server process on a
  different port to write to the target collection I can read other
  collections without delay, the collection I'm loading into is (obviously)
  blocked by the upd.basex flag.
 
  Is there no parallelisation involved that would separate reading from
  writing processes, or does that only come into play for xquery updates
 that
  run under the transaction module?
 
  My PARALLEL setting is at the default of 8 and I'm on version 8.0.1. And
 I
  apologise already if I missed some obvious configuration...
 
  Thanks to everyone involved in this project!
 
 
 
  David Mathei
 



Re: [basex-talk] Invoking database update from RESTXQ

2015-03-03 Thread Lukas Kircher
Hi Lars,

are you annotating your RESTXQ endpoints with %updating? F.i.:

declare
  %rest:path('/somepath')
  *%updating*
  function _:update()
{
  updates ...
};

Cheers,
Lukas

On Tue, Mar 3, 2015 at 10:36 AM, Lars Johnsen yoon...@gmail.com wrote:

 Hello all

 I was wondering how to perform database updating, like db:add, in RESTXQ,
 since the adding and updating functions throw errors when invoked inside
 functions defined in RESTXQ-modules.

 Have been trying to use the forward mechanism, transferring the data to a
 script without functions, with no success.

 Best,
 Lars G Johnsen




Re: [basex-talk] duplicate keys, because of missing commit

2015-02-10 Thread Lukas Kircher
Hi Christoph,

I’m forwarding my answer (including yours) to the mailing list, as I think it 
is valuable input.

I totally agree that the ‘equivalency' XQuery/transaction is very limiting. It 
sometimes leads to weird constructs trying to bypass the limitation.

Quite often though the limitation is actually useful, as it forces you to 
re-write your query in a way that it fits a single transaction. Within a single 
transaction the compiler then has a lot more room for optimization etc.. I’m 
not defending our current approach here - there are cases where it causes real 
pain and affects overall application design. But I also think that, more often 
then not, a functional programming approach also solves the issue including all 
the benefits. After all, the concept of the XQuery Update Facility is true to 
the functional nature of XQuery, where variables are final (and cannot be 
changed once initiated). Extending XQuery with db:commit() kind of breaks these 
basic principles. I also think support for ‘chaining transactions’ would be 
beneficial, but maybe on another level (commands?).

We write loads of production code in XQuery and this reflects just our 
experience - but I’d be happy to hear what others have to say.

Cheers,
Lukas


 On 09 Feb 2015, at 09:38, Christoph Gaukel christoph.gau...@gmx.de wrote:
 
 Hi Lukas,
 
 thank you for your answer, but this is no good news. In my specific case, i 
 see a variant to solve the problem. But i think, that the concept of 
 transactions, which combines a number of updating commands into an atomic 
 unit, is a good idea and it is a heavy load on the freedom of design if the 
 only chance, to build transactions is the unit of an xquery.
 
 From my point of view, it would be an important improvement, if something 
 like the commit of sql would be added to the xquery-language. If BaseX would 
 introduce it as a specific extension like db:commit(), this would be great!
 
 Cheers,
 Christoph



Re: [basex-talk] duplicate keys, because of missing commit

2015-02-06 Thread Lukas Kircher
Hi Christoph,

 the following xquery results in duplicate keys or missed updates, if we get 
 two messages of the same person in one xml-document. All updates in the 
 database are done at the end of the xquery and the reading inbetween gets the 
 old state of the database.

Correct. This is dictated by the XQuery Update Facility and helps to bypass 
problems with dirty reads etc.

 Is there a command to persist the actual state (like commit in sql)? If not, 
 i need some help for my design, because i have no idea, how to get a stable 
 processing.  

No. There is no way to interfere with this mechanism. As a rule of thumb - to 
modify the same item or node within the same transaction several times calls 
for an aggregation of all changes beforehand and applying these as a single 
update. In your specific case, 'updateMitglied()’ should be called only once 
with parameters that lead to a consistent state of a ‘Mitglied’. With the 
information you gave us I assume this starts with a ‘group by person’ on the 
messages …

Hope this helps, cheers,
Lukas

Re: [basex-talk] following::* is 100x slower than preceding::*

2015-02-05 Thread Lukas Kircher
Hi Gioele,

I just want to add a quick clarification as I feel like some stuff got mixed up 
here (Christian
may correct me if his version is backed by some compiler-voodoo that I’m 
neglecting, as he
definitely knows more about the matter).

In the end, the performance depends strongly on your document structure. The
‘following’ version is expensive if the resulting node(s) of '//*[@xml:id = 
lemma-aMSa”]’
have a lot of following nodes (siblings included). If there are lots of 
preceding nodes,
the ‘preceding’ query version could be more expensive.

Point being, evaluation of the following axis is not exactly expensive in 
BaseX, at least compared
to the preceding axis (also mind, that we have a reference to the first 
following node of a node, but
not to the preceding node). Arriving at a conclusion about axis evaluation 
performance cannot be
based on the two given queries (as they are non-equivalent).

Hope this doesn’t add to the confusion, though I think it does -
Lukas


 On 05 Feb 2015, at 14:23, Christian Grün christian.gr...@gmail.com wrote:
 
 Hi Gioele,
 
 I can confirm that the following axis is pretty expensive in BaseX, as
 we do not store explicit sibling references. The preceding axis is
 cheaper as we can stop search as soon as we traverse over the node we
 started from.
 
 One way out is to first access the following nodes in your document
 and move the preceding node check in a predicate.
 
 Also, I also get a warning about «'following::*[(self::tei:entry or
 self::tei:re)][(fn:position() = 3)]' will never yield results.» but that is
 obviously false, as it yields exactly the 3 results I expect.
 
 That's surprising indeed. Yes, feel free to send me your XML document
 in private.
 
 Hope this helps,
 Christian
 
 
 On Thu, Feb 5, 2015 at 2:12 PM, Gioele Barabucci gio...@svario.it wrote:
 Hello,
 
 I have noticed that this query using the following axes
 
//*[@xml:id = lemma-aMSa]
/following::*[self::tei:entry or self::tei:re]
 [position() = 3]
 
 is much slower than the same query with the preceding axes
 
//*[@xml:id = lemma-aMSa]
/preceding::*[self::tei:entry or self::tei:re]
 [position() = 3]
 
 The query that uses preceding takes about 2.5 ms to execute, while the one
 using following takes about 250 ms: it is 100 times slower.
 
 Why this discrepancy between these two queries?
 
 I can provide the base XML file (19MB) on request.
 
 Also, I also get a warning about «'following::*[(self::tei:entry or
 self::tei:re)][(fn:position() = 3)]' will never yield results.» but that is
 obviously false, as it yields exactly the 3 results I expect.
 
 Regards,
 
 --
 Gioele Barabucci gio...@svario.it
 



Re: [basex-talk] following::* is 100x slower than preceding::*

2015-02-05 Thread Lukas Kircher
Draw : )  - 15:25.

 On 05 Feb 2015, at 15:25, Lukas Kircher lukaskirch...@gmail.com wrote:
 
 my question is: once the engine has found the node(s) `//*[@xml:id = 
 lemma-aMSa”]`, couldn't it stop searching for nodes that match 
 `following::*[(self::tei:entry or self::tei:re)]` once it has found 3 of 
 them?
 
 Correct. Well, maybe.
 
 Or, in other words, couldn't a positional predicate like `[position() = 3]` 
 be used to short-circuit the preceding part of the query? I am pretty sure 
 that Saxon, for example, does exactly that for simple positional predicates 
 like `[1]` or `[position() = X]`.
 
 Christian is actually doing a very good job enabling the compiler to catch 
 exactely these cases. Unfortunately it is far from trivial to detect each 
 possible scenario. With your given query the optimization might be triggered 
 if you put the first part of the expression in brackets, like:
 
 (
 //*[@xml:id = lemma-aMSa]
/following::*[self::tei:entry or self::tei:re]
 )
 [position() = 3]
 
 Note: this only works, if there’s only one node with the id lemma-aMSa” in 
 your document, otherwise the expressions are not equivalent. If this is not 
 the case or if the brackets don’t fix it, I’m passing on to Christian for 
 either an explanation or a faster-than-expected fix.
 
 Cheers ...



Re: [basex-talk] following::* is 100x slower than preceding::*

2015-02-05 Thread Lukas Kircher
 my question is: once the engine has found the node(s) `//*[@xml:id = 
 lemma-aMSa”]`, couldn't it stop searching for nodes that match 
 `following::*[(self::tei:entry or self::tei:re)]` once it has found 3 of them?

Correct. Well, maybe.

 Or, in other words, couldn't a positional predicate like `[position() = 3]` 
 be used to short-circuit the preceding part of the query? I am pretty sure 
 that Saxon, for example, does exactly that for simple positional predicates 
 like `[1]` or `[position() = X]`.

Christian is actually doing a very good job enabling the compiler to catch 
exactely these cases. Unfortunately it is far from trivial to detect each 
possible scenario. With your given query the optimization might be triggered if 
you put the first part of the expression in brackets, like:

(
//*[@xml:id = lemma-aMSa]
   /following::*[self::tei:entry or self::tei:re]
)
[position() = 3]

Note: this only works, if there’s only one node with the id lemma-aMSa” in 
your document, otherwise the expressions are not equivalent. If this is not the 
case or if the brackets don’t fix it, I’m passing on to Christian for either an 
explanation or a faster-than-expected fix.

Cheers ...

Re: [basex-talk] following::* is 100x slower than preceding::*

2015-02-05 Thread Lukas Kircher
 in version 7.9 using the parenthesis like this does not help, I get the same 
 ~250 milliseconds.

Suggest you try the latest snapshot (8.0), things change fast.

 Actually I am surprised, as I was expecting this to be slower as it is more 
 general and requires more data to be computed.

(might be wrong here) The results of the descendant step are streamed/pipelined 
to the following step. Meaning for one result of the descendant step, the 
following step is evaluated. If there are three results we’re done (w/ 
brackets). BaseX 8.0 might fix this if 7.9 doesn't.

 In my mind this query is harder to optimize than mine, because officially 
 the engine would have to: first, find all the nodes following the first node 
 matching `//*[...]`, then all the nodes following the second node matching 
 `//*[...]` and, only at the end, be able to sum them all and select only the 
 first 3 nodes.

‘Officially' is the magic word here (lots of stuff happens ‘actually’) - see 
above (streaming) + w/o the brackets each result node of '//*[@xml:id = 
lemma-aMSa”]’ has to be checked, as the predicate binds to the following step. 
You’d get the first 3 following nodes of each descendant step result node. If 
there’s only one, it doesn’t matter. Else you cannot optimize your query beyond 
a certain point. 

You see, lots of if’s … but good questions!

Re: [basex-talk] Silly XQUERY exception

2015-01-07 Thread Lukas Kircher
Hi Mansi,

 let $cmd := /A/*/descendant::C/descandant::*[contains(@name,'|| $n ||')]”

Just a quick scan - I marked the problem in bold above - I would try 
‘descendant’
instead of 'descandant’.

Cheers,
Lukas



Re: [basex-talk] slow response time over large update query

2014-05-16 Thread Lukas Kircher
Hi Yannis,

between version 7.8.2 and 8.0 we identified a weak-sport regarding updates
and namespaces - which is already fixed in the latest stable snapshot. I’m
almost 100% sure that this is responsible for the performance drawbacks that
you experience. In general you can expect BaseX to be really fast with
updates.

I would recommend to switch to the latest stable snapshot, as since BaseX 7.8.2
some more things have been fixed and improved. Would be nice if you could report
back whether the problem persists - and sorry for the inconveniences.

Cheers,
Lukas


On 16 May 2014, at 11:49, Ioannis Kavvouras i.kavvou...@di.uoa.gr wrote:

 I try the following insert query:
 insert node coverage id=''/coverage into 
 /server[@endpoint='anEndpointId']/formal/lastimage/harvested/coverages
   • we insert a node/element, not a document.
   • the coverage node is approximately 500kB
   • node coverages has a lot of coverage nodes that differ with each 
 other in the id attribute.
 We run BaseX782. The database has a lot of namespaces in general but none of 
 them is outside the scope of coverage element. As you can see we use the full 
 path in the insertion.
 
 In general, get queries are fast, the only problem we have is with insertions 
 and replacements.
 
 Regards
 Yannis
 
 On 05/16/2014 12:40 PM, Lukas Kircher wrote:
 Hi Yannis,
 
 we need a little bit more information - as Dirk already pointed out.
 
 It would be especially interesting to know what you mean with ‘record’. Are 
 you
 trying to insert an element or a document? The internal process differs 
 greatly
 for both operations.
 
 Which version of BaseX are you using? What about Namespaces in the database?
 
 Cheers,
 Lukas
 
 
 On 16 May 2014, at 11:35, Dirk Kirsten 
 d...@basex.org
  wrote:
 
 
 Hello Yannis,
 
 that is hard to tell. Please describe in more detail what you do, which
 commands/queries you run and possibly input data.
 
 For sure it is not in a general case - I just tested it on a 112MB XMark
 file and a update of one node took around 200ms. But depending on what
 you do it might be normal (e.g. if you search the node with an
 exponential runtime it might very well be).
 
 Cheers,
 Dirk
 
 On 16/05/14 11:26, Ioannis Kavvouras wrote:
 
 Hello,
 
 We try to insert/replace a record (size of ~500KB) in a file of 100MB.
 The query requires more than 10minutes in order to completed.
 Could you please tell if the previous is normal?
 
 Regards
 Yannis
 
 -- 
 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] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Lukas Kircher
Hi Andy,

- just a quick report, as I wasn't able to solve the problem so far.

This working using curl as the client

 curl -X PUT -T aa.pdf http://localhost:9998/tika

 If I add '--header Content-Type: application/pdf ' it works fine for me,
too. If I don't specify the content-type I get a 415: Unsupported Media
Type. Just for others as a note ...

If I run the following:

let
  $file:=some.pdf,
  $request :=
http:request  method='PUT'
 http:body media-type=application/octet-stream{
  fetch:binary($file)
 }/http:body
/http:request
return
 http:send-request($request,http://localhost:9998/tika;)

I get from BaseX (running in debug mode):

*java.lang.IllegalArgumentException: object is not an instance of declaring
class*

and (from Tika):

*INFO: tika (autodetecting type)*

Looks like there's already going something wrong on BaseX level. I still
get a response from Tika, but not the one I expected. If I change the
media-type to 'application/pdf' I no longer get the BaseX error, but a
document processing error (500) from Tika. 'application/pdf' is also the
media type that 'fetch:content-type()' returns..

So if it's not further specified, Tika tries to guess the content type but
cannot find one. If it's specified it returns a processing error. Like you
said maybe a problem with the content (as the content-length headers
differ).

Sorry for not being of much help but maybe someone else has an idea?

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


Re: [basex-talk] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Lukas Kircher
Hi all,

again:

curl -v -X PUT -T some.pdf http://localhost:9998/tika --header
Content-Type: application/pdf

... and tika returns plain text as it should - so a working MIME type would
be 'application/pdf'.


*Now off to BaseX:*

 let
 $request :=
  http:request  method='PUT'
http:body media-type=application/pdf src=some.pdf/
  /http:request
return
 http:send-request($request,http://localhost:9998/tika;)

*For this, tika returns 415* - unsupported media type. Although specifying
the MIME type this time, the content that BaseX sends does not look like
what tika expects.

let
  $file:=some.pdf,
  $request :=
http:request  method='PUT'
 http:body media-type=application/pdf{
  fetch:binary($file)
 }/http:body
/http:request
return
 http:send-request($request,http://localhost:9998/tika;)

*For this, tika returns 500* - processing error. Media type is specified to
'application/pdf' which works with curl (see above) but not with BaseX.
Also the tcpdump differs for the BaseX requests, as expected. So either
we're doing something really wrong, or BaseX sends the content in a way
it's not supposed to. In the latter case I'm not the one to look into this
issue and we have to wait for someone to take a proper look at it.

Regards,
Lukas


On Sun, Jan 5, 2014 at 5:06 PM, Andy Bunce bunce.a...@gmail.com wrote:

 Hi Dirk,
 The Tika documentation is not very clear[1]. tika-app has a simple server
 mode. tika-server, which I am using,  is a different jar [2]

 [1]
 http://stackoverflow.com/questions/12231630/how-to-use-tika-in-server-mode
 [2] http://mvnrepository.com/artifact/org.apache.tika/tika-server/1.4


 On Sun, Jan 5, 2014 at 3:39 PM, Dirk Kirsten d...@basex.org wrote:

 Hello,

 You can also simple get all the request headers using the -v flag when
 running curl. Or you could use wireshark, which (at least to me) seems
 easier than using tcpdump.

 I'd like to reproduce your problem, but I seem to be too stupid to get
 the Tika server up and running.
 When running
   java -jar tika-app-1.4.jar -s 

 (or even with the verbose flag) I simply don't get any thing (but a
 running process) and the server seems to me not properly started, e.g.
 if I do
   curl -X GET http://localhost:9998/tika

 I simply get nothing (I don't get any response, servers seems not to
 send any response).

 However, I would suggest to try to look at the request sent by curl, as
 curl sets some headers automatically and I also experienced similar
 problems before (i.e. for some servers not setting some obscure headers
 seems to be fatal...)

 Cheers,
 Dirk


 On 05/01/14 15:00, Florent Georges wrote:
  On 5 January 2014 00:57, Andy Bunce wrote:
 
Hi,
 
  curl -X PUT -T aa.pdf http://localhost:9998/tika
  [...]
  I have tried:
  let $file:=C:\tmp\aa.pdf
  let $request :=
http:request  method='PUT'
  http:body media-type=application/octet-stream{
fetch:binary($file)
  }/http:body
  /http:request
 
I do not know Tika, I do not have BaseX on this machine, and you did
  not give a lot of details about what is not working nor error messages,
  so it is a bit difficult to help here.  All I can say is that I would
  use the following as the EXPath HTTP Client equivalent to the above
  CURL command:
 
  http:request method=put
 http:body media-type=application/pdf
 src=file:/c:/tmp/aa.pdf/
  /http:request
 
The @media-type is mandatory.  You do not set any explicitly with
  CURL, so you should probably find which MIME type works with CURL in
  the first place.  The @src lets the processor handle the details of
  accessing the binary file, which makes things easier and then you are
  sure the problem is not with fetch:binary() or with the analysis of
  the binary content of http:body.
 
If you find a MIME type that works with CURL (you can use the -H
  option like the following: -H Content-Type: application/pdf), and it
  is still failing, tcpdump can help as well.  Open a terminal window,
  and execute the following:
 
  sudo tcpdump -s 0 -A -i any tcp and host localhost and port 9998
 
This will dump all traffic to localhost:9998.  Then go to another
  terminal window (because tcpdump is still running) and execute the
  CURL command.  After the completion, go back to the first window and
  press Ctrl-C (to kill tcpdump).  In between, tcpdump has output to the
  console a dump of the request.  It will as well if you keep it running
  when you test your query in BaseX.  So you can compare both requests
  and see what is different (or post it here so we can see what is
  happening).
 
Regards,
 

 --
 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
 ___
 BaseX-Talk mailing list
 

Re: [basex-talk] 7.7.x UI freeze

2013-12-23 Thread Lukas Kircher
Filed a bug report on github [1] for now ...

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


On Mon, Dec 23, 2013 at 11:18 AM, Lukas Kircher 
lukas.kirc...@uni-konstanz.de wrote:

 Hi Pascal,

 Recently upgraded to 7.7.2 from 7.6 and getting UI freeze on MacOSX when
 I try to open existing databases.


 I also experienced this issue once or twice but wasn't exactly able to
 reproduce it
 on purpose. Your report simply tells me that there's indeed an issue with
 7.7.2/
 7.7.3 and we should take a closer look at it - thanks for the report. Do
 you also
 experience the same freezes with the latest stable snapshot (7.8)?


 When opening from the interactie
 command prompt, I get a message that the format has changed and I need
 to rebuild indexes.


 I would serialize the database content to disk with 7.6 and create new
 databases from the exported files. Between version 7.7.2/7.7.3/7.8 the
 database
  format changes again - another reason to consider giving version 7.8 a go.

 Sorry for not being of too much help here ...

 Cheers,
 Lukas

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


Re: [basex-talk] Replace node attribute value

2013-11-12 Thread Lukas Kircher
Hi Thomas,

just remove the 'attribute' token from your statement, as it is not
necessary ...

*replace value of node /mondial/country[@name='Austria']/@car_code with 'B'*

Cheers,
Lukas


On Tue, Nov 12, 2013 at 5:13 PM, Thomas Knight tom1vuu2...@gmail.comwrote:

 Hi everyone,

 I have a problem trying to replace the attribute value.

 For example, using factbook.xml:

 replace value of node attribute
 /mondial/country[@name='Austria']/@car_code with 'B'

 fails with:

 [XUDY0027] Replace target must not be empty.

 How should I be doing this?

 Thanks


 Tom

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


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


Re: [basex-talk] XUDY0027 - Insert target must not be empty with default namespaces

2013-07-08 Thread Lukas Kircher
Hi Carlos,

the element two/ in the second example is also bound to the default
namespace, so you have to take care of this. Adding a wildcard to the
name test (.../**:two*) should do the trick. Your final insert query then
looks
like this:

insert node three/ into db:open(MyDB, q471pa0lnovkfflso7ecsd6nj1.
xml)/*:one/*:two

If the problem persists just get back to us.

Hope this helps, have a nice day,
Lukas


On Mon, Jul 8, 2013 at 1:49 PM, Carlos MARCOS LAGUNAR 
carlos.mar...@atosresearch.eu wrote:

 Hi,

 ** **

 I’m working with latests BaseX distribution. The problem arises when I
 change from a specific namespace to a default namespace on the XML file.
 From that moment on the insertion becomes messy, since some of them fail.
 Example:

 Here is the source XML that I insert into the newly created DataBase:

 ** **

 n:one xmlns:n=oneone

   two / 

 /n:one

 ** **

 I execute then a xquery to insert a node into the empty tag “two”:  insert
 node three/ into db:open(MyDB,
 q471pa0lnovkfflso7ecsd6nj1.xml)/*:one/two

 ** **

 In that case, I get a successful insertion: If I query the file 
 (db:open(MyDB,
 q471pa0lnovkfflso7ecsd6nj1.xml)/*:one) I get:

 ** **

 n:one xmlns:n=oneone

   two

 three / 

   /two

 /n:one

 ** **

 This is the normal behavior. The problem comes when I try to set that
 namespace as the default. So I create a new DataBase with the following XML:
 

 ** **

 one *xmlns=oneone*

   two / 

 /one

 ** **

 When I try to execute the same xquery as before (insert node three/
 into db:open(MyDB, q471pa0lnovkfflso7ecsd6nj1.xml)/*:one/two) I get
 the following error:

 ** **

 rg.basex.core.BaseXException: Stopped at line 1, column 84: [XUDY0027]
 Insert target must not be empty

 ** **

 I cannot understand then why the namespace affects the insertion this way
 :-/   I’m querying and insertion from a Java application by using
 JavaClient, although I guess this is not relevant here.

 ** **

 Any help would be appreciated.

 ** **

 Thank you and best regards,

 ** **

   C.

 ** **

 --
 This e-mail and the documents attached are confidential and intended
 solely for the addressee; it may also be privileged. If you receive
 this e-mail in error, please notify the sender immediately and destroy it.
 As its integrity cannot be secured on the Internet, the Atos
 group liability cannot be triggered for the message content. Although
 the sender endeavours to maintain a computer virus-free network,
 the sender does not warrant that this transmission is virus-free and
 will not be liable for any damages resulting from any virus transmitted.

 Este mensaje y los ficheros adjuntos pueden contener informacion
 confidencial
 destinada solamente a la(s) persona(s) mencionadas anteriormente
 pueden estar protegidos por secreto profesional.
 Si usted recibe este correo electronico por error, gracias por informar
 inmediatamente al remitente y destruir el mensaje.
 Al no estar asegurada la integridad de este mensaje sobre la red, Atos
 no se hace responsable por su contenido. Su contenido no constituye ningun
 compromiso para el grupo Atos, salvo ratificacion escrita por ambas
 partes.
 Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor
 no puede garantizar nada al respecto y no sera responsable de cualesquiera
 danos que puedan resultar de una transmision de virus.
 --

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


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


Re: [basex-talk] [GUI] Properties window is frozen for a DB with a lot of documents

2013-03-26 Thread Lukas Kircher
Hi Fabrice,

we just uploaded a fix (hopefully) for this problem. The maximum number of
displayed nodes is now limited. Would be nice if you could report your
experience with the current solution, which will be contained in the next
latest stable release.

Cheers,
Lukas

On Fri, Mar 15, 2013 at 9:36 AM, Fabrice Etanchaud
fetanch...@questel.comwrote:

  Dear all,

 ** **

 When dealing with collections containing more than a million documents,***
 *

 The Properties window freezes the entire GUI while  trying to display the
 documents’ list.

 How could I disable the treeview for such collections ?

 ** **

 I have to deal with such collections because XQuery Update on many many
 nodes takes a long long time to complete,

 So add/replace/delete is a good alternative.

 ** **

 Thank you for your continuous help and your great XNDB.

 ** **

 Last : is the new ADDCACHE option the way to add data near the node count
 limit without corrupting the collection ?

 ** **

 Best regards,

 Fabrice

 Questel-Orbit

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


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


Re: [basex-talk] Bug (?): Document damaged after db upload

2013-03-24 Thread Lukas Kircher
Hi Hans-Juergen and Arve,

I'm taking a look at the issue and get back to you as soon as it's fixed or
we know how to deal with it.

Cheers,
Lukas


On Fri, Mar 22, 2013 at 3:22 PM, Hans-Juergen Rennau hren...@yahoo.dewrote:

 Dear BaseX team,

 I encountered a strange phenomenon: after loading a document into the
 database (using db:create), ordinary retrieval yields a phantom with
 distorted namespaces, like this:

 Accommodation xmlns=http://otds-group.org/otds;
   Availabilities xmlns= xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xmlns=
 http://otds-group.org/otds; Key=1Z
 Availability xmlns= xmlns=http://otds-group.org/otds; Key=1Z
 StartDate=2013-05-01 EndDate=2013-10-31
   DefaultDayState xmlns= xmlns=http://otds-group.org/otds;
 Open xmlns= xmlns=http://otds-group.org/otds/
   /DefaultDayState
 /Availability
 ...

 Note the xmlns=, side by side with xmlns=

 This is the query:

 let $c := * return element {node-name($c)} {$c/*:Availabilities}

 And this is the (correct) result I obtain if I use as input not the
 uploaded document, but the original file:

 Accommodation xmlns=http://otds-group.org/otds;
   Availabilities xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 Key=1Z
 Availability Key=1Z StartDate=2013-05-01 EndDate=2013-10-31
   DefaultDayState
 Open/
   /DefaultDayState
 /Availability
 ...

 I wanted to reproduce the problem with a minimal input document, but then
 the error did not occur.

 The document producing the error has 286 KB.

 One more remark: after droping all databases and repeating the exercise,
 the problem still remained.

 Kind regards,
 Hans-Juergen

 PS: If a team member would like to receive the input file, I would send it
 to him or her directly.

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


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


Re: [basex-talk] [UPDINDEX] db:add bug

2013-03-21 Thread Lukas Kircher
Hi Fabrice,

Christian just uploaded a new [snapshot] that should fix the problem.
Thanks for your report!

Cheers,
Lukas

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


On Fri, Mar 15, 2013 at 5:04 PM, Fabrice Etanchaud
fetanch...@questel.comwrote:

  Dear all,

 ** **

 The following list of commands/queries lead to a bug report :

 ** **

 Set updindex true

 ** **

 Create db mydb

 ** **

 db:add('mydb',root/,'mydb.xml')

 ** **

 Error: 

 Improper use? Potential bug? Your feedback is welcome:

 Contact: basex-talk@mailman.uni-konstanz.de

 Version: BaseX 7.7 beta

 Java: Oracle Corporation, 1.7.0_15

 OS: Windows 7, amd64

 Stack Trace:

 java.lang.NullPointerException

   org.basex.data.Data.insert(Data.java:840)

   org.basex.query.up.primitives.DBNew.addDocs(DBNew.java:57)

   org.basex.query.up.primitives.DBAdd.prepare(DBAdd.java:49)

   org.basex.query.up.DatabaseUpdates.check(DatabaseUpdates.java:109)

   org.basex.query.up.ContextModifier.apply(ContextModifier.java:89)

   org.basex.query.up.Updates.apply(Updates.java:120)

   org.basex.query.QueryContext.update(QueryContext.java:281)

   org.basex.query.QueryContext.value(QueryContext.java:265)

   org.basex.query.QueryContext.iter(QueryContext.java:250)

   org.basex.query.QueryContext.execute(QueryContext.java:499)

   org.basex.query.QueryProcessor.execute(QueryProcessor.java:96)

   org.basex.core.cmd.AQuery.query(AQuery.java:77)

   org.basex.core.cmd.XQuery.run(XQuery.java:22)

   org.basex.core.Command.run(Command.java:342)

   org.basex.core.Command.exec(Command.java:321)

   org.basex.core.Command.execute(Command.java:78)

   org.basex.gui.GUI.exec(GUI.java:397)

   org.basex.gui.GUI$7.run(GUI.java:349)

 Query plan: 

 QueryPlan

   FNDb name=add(database,input[,path])

 Str value=mydb type=xs:string/

 CElem

   QNm value=root type=xs:QName/

 /CElem

 Str value=mydb.xml type=xs:string/

   /FNDb

 /QueryPlan

 ** **

 Have a nice week-end.

 ** **

 Fabrice

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


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


Re: [basex-talk] Scientific Numbers in Scatter Plot

2013-01-25 Thread Lukas Kircher
Hi Greg,

the scatter plot takes its information whether an attribute is
numerical/categorical from
some DB statistics. The checkbox for the log scale in your provided
screenshot is
deactivated - most likely because BaseX assumes that the TIME attribute is
categorical.
This explains the lexicographic order and the different casing (e-01 /
E-01).

A quick fix could be to convert the exponential to decimal representation
(if you need the
plot at the moment). For now I'm filing an [issue] on GitHub.

Is it possible that you supply us with a part of the document that
reproduces the issue?


Regards,
Lukas

[issue] https://github.com/BaseXdb/basex/issues/626






On Fri, Jan 25, 2013 at 1:38 PM, IVES Greg greg.i...@uk.thalesgroup.comwrote:

  Hi

 I find BaseX a very powerful tool.

 One thing I noticed however is that it misunderstands numbers in
 scientific notation in the scatter plot display.

 Please see the attached plot.

 The samples should form a rough diagonal line.

 However, look at the scale on the left and you can see the exponent field
 is 'dis-continuous'.

 It looks like the chart formatter treats it as a non-scientific number or
 possibly even lexicographic order.

 ** **

 ** **

 Best Regards

 Greg

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


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


Re: [basex-talk] Need help on Xquery create Collection using java

2012-10-19 Thread Lukas Kircher
Hi Riyaz,

I'm really busy today, but I'll try my best to help you out.

1) You can find a number of [Java examples] in our documentation.
2) There's also a specific code example on creating a [BXCollection]
via XMLDB.

Please note that the XMLDB section in the [Java examples] is flagged
deprecated - but I'm not exactly sure what the actual state of the
implementation is. Maybe someone else can fill you in on that. So it might
be worth it considering a switch to our internal API ...

Regards, don't hesitate to ask if you need help.
Lukas


[Java examples] http://docs.basex.org/wiki/Java_Examples
[BXCollection]
https://github.com/BaseXdb/basex-examples/blob/master/src/main/java/org/basex/examples/xmldb/XMLDBCreate.java




On Fri, Oct 19, 2012 at 8:15 AM, riyaz riyaz.ba...@intense.in wrote:

  Dear lukas,

  Would there be major code changes required to create collection if I
 migrate from basex671 to basex-7.3 jar.
 Because in the first step I am getting

   new BXCollection(collection, true, objContext) - Can't find symbol
 constructor.

 It is taking BxDatabase as third argument. I need to see any example codes
 on creating collection using basex7.3 , so that I can do it on my own.

 Would you please help me on this.

 --
 Thanks  Regards,
 Riyaz Shaik,
 In10^s Technologies Ltd.

 * What you risk reveals what you value.*


 On 10/18/2012 3:02 PM, Lukas Kircher wrote:

 Hi Riyaz,

 that's a good starting point - a huge load of things changed
 with BaseX since 671, so just have a look.

 Are you using the full text index?

 Regards,
 Lukas


 On Thu, Oct 18, 2012 at 11:20 AM, riyaz riyaz.ba...@intense.in 
 riyaz.ba...@intense.in wrote:


   Dear Lukas,

 Thanks for the quick response.

 1) I am using Basex671.jar and basex-api.jar. Seems it is not latest
 one. I will check with latest jar and update you.

and also

 2)  while iterating in a for loop we are adding one by one xml and
 where each xml is of 100kb on an average to collection.

  199MB of multiple files( around 2000+ xml documents) to a single
 collection is taking 440 mb on harddisk.

 //strAtr is a string array and contains file paths
 for (int j = 0; j  strAtr.length; j++) {
  new Add(strAtr[j]).execute(
 context);
 }

 Please let me know if anything can be done, or anything needed for more
 clarification.

 --
 Thanks  Regards,
 Riyaz Shaik,
 In10^s Technologies Ltd.

 * What you risk reveals what you value.*




 On 10/18/2012 2:18 PM, Lukas Kircher wrote:

 just a little addition:

 Depending on the nature of the document you add
 and the kind of active indexes there will be some
 overhead in size and space.

 400MB/3min for a 199MB document sounds a little
 special though ...



 On Thu, Oct 18, 2012 at 10:33 AM, Lukas Kircher lukaskirch...@gmail.com 
 lukaskirch...@gmail.com lukaskirch...@gmail.com 
 lukaskirch...@gmail.comwrote:


  Hi Riyaz,

 1) do you use the [latest stable snapshot] or [latest release] of BaseX?

 2) Could you equip us with some more facts about your case, like the
 exact query, the document (structure) or maybe even an SSCCE? You
 could also send it directly to one of us if you don't want to post it to
 the
 list.

 Regards,
 Lukas


 [latest stable snapshot] http://files.basex.org/releases/latest/
 [latest release] http://files.basex.org/releases/7.3/



 On Thu, Oct 18, 2012 at 6:54 AM, riyaz riyaz.ba...@intense.in 
 riyaz.ba...@intense.in riyaz.ba...@intense.in riyaz.ba...@intense.in 
 wrote:


   Dear Team,

This is Riyaz from Hyderabad , India. I have been using X query
 since one and half year. I need help on the following query.

  When I add xmls of 199 MB to create collection using  new
 Add(xmlfilepath).execute(
 context) (JAVA), it is taking 440 MB on hard disk
 and 3 mins to complete the
 process. Is there any other way to reduce the size and time?

Thanks a ton in advance and would appreciate the earliest response.
 Please help me on this.

 --
 Thanks  Regards,
 Riyaz Shaik,
 In10^s Technologies Ltd.

 * What you risk reveals what you value.*

 ___
 BaseX-Talk mailing 
 listbasex-t...@mailman.uni-konstanz.dehttps://mailman.uni-konstanz.de/mailman/listinfo/basex-talk






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


Re: [basex-talk] Need help on Xquery create Collection using java

2012-10-18 Thread Lukas Kircher
Hi Riyaz,

1) do you use the [latest stable snapshot] or [latest release] of BaseX?

2) Could you equip us with some more facts about your case, like the
exact query, the document (structure) or maybe even an SSCCE? You
could also send it directly to one of us if you don't want to post it to the
list.

Regards,
Lukas


[latest stable snapshot] http://files.basex.org/releases/latest/
[latest release] http://files.basex.org/releases/7.3/


On Thu, Oct 18, 2012 at 6:54 AM, riyaz riyaz.ba...@intense.in wrote:

  Dear Team,

This is Riyaz from Hyderabad , India. I have been using X query
 since one and half year. I need help on the following query.

  When I add xmls of 199 MB to create collection using  new
 Add(xmlfilepath).execute(context) (JAVA), it is taking 440 MB on hard disk
 and 3 mins to complete the
 process. Is there any other way to reduce the size and time?

Thanks a ton in advance and would appreciate the earliest response.
 Please help me on this.

 --
 Thanks  Regards,
 Riyaz Shaik,
 In10^s Technologies Ltd.

 * What you risk reveals what you value.*

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


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


Re: [basex-talk] Need help on Xquery create Collection using java

2012-10-18 Thread Lukas Kircher
Hi Riyaz,

that's a good starting point - a huge load of things changed
with BaseX since 671, so just have a look.

Are you using the full text index?

Regards,
Lukas


On Thu, Oct 18, 2012 at 11:20 AM, riyaz riyaz.ba...@intense.in wrote:

  Dear Lukas,

 Thanks for the quick response.

 1) I am using Basex671.jar and basex-api.jar. Seems it is not latest
 one. I will check with latest jar and update you.

and also

 2)  while iterating in a for loop we are adding one by one xml and
 where each xml is of 100kb on an average to collection.

  199MB of multiple files( around 2000+ xml documents) to a single
 collection is taking 440 mb on harddisk.

 //strAtr is a string array and contains file paths
 for (int j = 0; j  strAtr.length; j++) {
  new Add(strAtr[j]).execute(context);
 }

 Please let me know if anything can be done, or anything needed for more
 clarification.

 --
 Thanks  Regards,
 Riyaz Shaik,
 In10^s Technologies Ltd.

 * What you risk reveals what you value.*




 On 10/18/2012 2:18 PM, Lukas Kircher wrote:

 just a little addition:

 Depending on the nature of the document you add
 and the kind of active indexes there will be some
 overhead in size and space.

 400MB/3min for a 199MB document sounds a little
 special though ...



 On Thu, Oct 18, 2012 at 10:33 AM, Lukas Kircher lukaskirch...@gmail.com 
 lukaskirch...@gmail.comwrote:


  Hi Riyaz,

 1) do you use the [latest stable snapshot] or [latest release] of BaseX?

 2) Could you equip us with some more facts about your case, like the
 exact query, the document (structure) or maybe even an SSCCE? You
 could also send it directly to one of us if you don't want to post it to
 the
 list.

 Regards,
 Lukas


 [latest stable snapshot] http://files.basex.org/releases/latest/
 [latest release] http://files.basex.org/releases/7.3/


 On Thu, Oct 18, 2012 at 6:54 AM, riyaz riyaz.ba...@intense.in 
 riyaz.ba...@intense.in wrote:


   Dear Team,

This is Riyaz from Hyderabad , India. I have been using X query
 since one and half year. I need help on the following query.

  When I add xmls of 199 MB to create collection using  new
 Add(xmlfilepath).execute(
 context) (JAVA), it is taking 440 MB on hard disk
 and 3 mins to complete the
 process. Is there any other way to reduce the size and time?

Thanks a ton in advance and would appreciate the earliest response.
 Please help me on this.

 --
 Thanks  Regards,
 Riyaz Shaik,
 In10^s Technologies Ltd.

 * What you risk reveals what you value.*

 ___
 BaseX-Talk mailing 
 listbasex-t...@mailman.uni-konstanz.dehttps://mailman.uni-konstanz.de/mailman/listinfo/basex-talk




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


Re: [basex-talk] update database with insert and db:open-id

2012-10-10 Thread Lukas Kircher
Hi again - small addition:

1) to speed up the update process you just have to check
out the latest version of BaseX in our GitHub repository

2) to speed up the look-up of nodes you could experiment
with incremental index updates by setting the [UPDINDEX]
flag to true (please visit our [OPTIONS] documentation for
assistance)

If you have further questions just drop a note ...

Looking forward to your report!

Cheers,
Lukas


[UPDINDEX] http://docs.basex.org/wiki/Options#UPDINDEX
[OPTIONS] http://docs.basex.org/wiki/Options

On Wed, Oct 10, 2012 at 10:40 AM, Lukas Kircher lukaskirch...@gmail.comwrote:

 Hi Tim,

 as a lucky coincidence we integrated a major optimization
 regarding updates yesterday evening that should speed up
 your scenario as well.

 It would be nice if you could take a look at it and report your
 experience. Just check it out at our [GitHub] repository.

 Cheers,
 Lukas



 [GitHub] https://github.com/BaseXdb/basex


 On Tue, Oct 9, 2012 at 3:05 PM, Tim Belschner 
 tim.belsch...@ils.uni-stuttgart.de wrote:

 [BaseX 7.3 with the internal editor]

 ** **

 Hello,

 ** **

 as a part of a query, I need to update more than ten thousand database
 entries with an additional attribute. For this, I thought about getting the
 node IDs with db:node-id(), storing them in an element sequence as
 attributes and use them afterwards as an identifier for the “update
 insert”. Unfortunately, it takes around 22 seconds to update all database
 entries. After some testing I got two bottlenecks:

 **1.   **the “insert node …” command and

 **2.   **the “db:open-id()” command

 Both of them cause a processing time of around 10 seconds each.

 ** **

 Is there a way to increase the update performance significantly?

 Maybe by setting some options of BaseX or using a different approach?

 ** **

 Best regards

 Tim

 ** **

 ** **

 Here is an example code (no practical sense just to demonstrate the
 current code for the updates):


 --CODE-
 

 (: create a list with the node IDs:)

 declare function local:GetDBIDs ($seq as element()+) as element()+

 {

   for $element in $seq

   let $DBID := db:node-id($element)   

   return ( element {'Doublet'} { attribute{'DBNodeID'}{$DBID} } )

 };

 ** **

 (: # MAIN PART # :)

 declare variable $dbname := 'db_enum_test';

 let $elements := DBSection

 let $doubletIDs :=
 element{'Doublets'}{local:GetDBIDs($elements/DatabaseEntry)}

 ** **

 for $element at $pos in $doubletIDs/child::*

 return (

   insert node (attribute {'DB_ID'}{xs:string(xs:integer('10') +
 $pos)} ) into db:open-id( $dbname, xs:integer(data($element/@DBNodeID)) )
 

 )


 --CODE-
 

 ** **

 and a query to create an example database:


 --DB-
 

 let $entries := for $i in (1 to 1)

 return (

   element {'DatabaseEntry'}{attribute
 {'id'}{xs:string($i)},

attribute
 {'word'}{concat('Scheduler_',xs:string($i*$i))},

attribute{'type'}{'INT32'}}

 )

 ** **

 let $entries2 := element  {'DBSection'}{$entries}

 return ( db:add(db_enum_test, document { $entries2 }, DB) )


 --DB-
 

 ** **

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



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


Re: [basex-talk] update database with insert and db:open-id

2012-10-10 Thread Lukas Kircher
Me again, sorry :)

Getting hands on the optimization just became easier -
simply download the latest [snapshot]. No need to
hussle with GitHub.

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



On Wed, Oct 10, 2012 at 10:56 AM, Lukas Kircher lukaskirch...@gmail.comwrote:

 Hi again - small addition:

 1) to speed up the update process you just have to check
 out the latest version of BaseX in our GitHub repository

 2) to speed up the look-up of nodes you could experiment
 with incremental index updates by setting the [UPDINDEX]
 flag to true (please visit our [OPTIONS] documentation for
 assistance)

 If you have further questions just drop a note ...

 Looking forward to your report!

 Cheers,
 Lukas


 [UPDINDEX] http://docs.basex.org/wiki/Options#UPDINDEX
 [OPTIONS] http://docs.basex.org/wiki/Options


 On Wed, Oct 10, 2012 at 10:40 AM, Lukas Kircher 
 lukaskirch...@gmail.comwrote:

 Hi Tim,

 as a lucky coincidence we integrated a major optimization
 regarding updates yesterday evening that should speed up
 your scenario as well.

 It would be nice if you could take a look at it and report your
 experience. Just check it out at our [GitHub] repository.

 Cheers,
 Lukas



 [GitHub] https://github.com/BaseXdb/basex


 On Tue, Oct 9, 2012 at 3:05 PM, Tim Belschner 
 tim.belsch...@ils.uni-stuttgart.de wrote:

 [BaseX 7.3 with the internal editor]

 ** **

 Hello,

 ** **

 as a part of a query, I need to update more than ten thousand database
 entries with an additional attribute. For this, I thought about getting the
 node IDs with db:node-id(), storing them in an element sequence as
 attributes and use them afterwards as an identifier for the “update
 insert”. Unfortunately, it takes around 22 seconds to update all database
 entries. After some testing I got two bottlenecks:

 **1.   **the “insert node …” command and

 **2.   **the “db:open-id()” command

 Both of them cause a processing time of around 10 seconds each.

 ** **

 Is there a way to increase the update performance significantly?

 Maybe by setting some options of BaseX or using a different approach?***
 *

 ** **

 Best regards

 Tim

 ** **

 ** **

 Here is an example code (no practical sense just to demonstrate the
 current code for the updates):


 --CODE-
 

 (: create a list with the node IDs:)

 declare function local:GetDBIDs ($seq as element()+) as element()+

 {

   for $element in $seq

   let $DBID := db:node-id($element)   

   return ( element {'Doublet'} { attribute{'DBNodeID'}{$DBID} } )

 };

 ** **

 (: # MAIN PART # :)

 declare variable $dbname := 'db_enum_test';

 let $elements := DBSection

 let $doubletIDs :=
 element{'Doublets'}{local:GetDBIDs($elements/DatabaseEntry)}

 ** **

 for $element at $pos in $doubletIDs/child::*

 return (

   insert node (attribute {'DB_ID'}{xs:string(xs:integer('10') +
 $pos)} ) into db:open-id( $dbname, xs:integer(data($element/@DBNodeID)) )
 

 )


 --CODE-
 

 ** **

 and a query to create an example database:


 --DB-
 

 let $entries := for $i in (1 to 1)

 return (

   element {'DatabaseEntry'}{attribute
 {'id'}{xs:string($i)},

attribute
 {'word'}{concat('Scheduler_',xs:string($i*$i))},

attribute{'type'}{'INT32'}}

 )

 ** **

 let $entries2 := element  {'DBSection'}{$entries}

 return ( db:add(db_enum_test, document { $entries2 }, DB) )


 --DB-
 

 ** **

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




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


Re: [basex-talk] BUG# Multiple Thread try to execute some Query

2012-09-28 Thread Lukas Kircher
Hi Samuel,

testing on my machine (OSX 10.8, Java 7) I can only report
what you already came across yourself:

- activating/deactivation output makes no difference
- Java 6/7 makes no difference
- limiting PARALLEL option to 1 seems to resolve the issue

As we couldn't figure out the problem on the fly I've created
an [issue] on Github. Feel free to add anything if you think it
might help.

Thanks for your report so far! I hope the current workaround
is good enough to keep you going until we figured out the real
problem.


Cheers,
Lukas


[issued] https://github.com/BaseXdb/basex/issues/574


On Thu, Sep 27, 2012 at 6:11 PM, Samuel Lacmene 
samuel.lacm...@buit-solutions.com wrote:

 I have only tested it with Java 7.

 I have adjusted the PARALLEL option to 1, my test runs until now without
 problem and I hope that it will stay so.
 I will let you know, if this setting walk for me or not.

 Thank,
 Samuel


 --


  I did not try it, because the bug occurs randomly. You should try it a
 lot
  of time to trigger it.
  Another possibility to increase the probability to see the bug is to run
  complex requests.

 I agree that this looks like a classical concurrency bug, but I still
 have a hard time narrowing it down, as I didn't manage yet to
 reproduce the problem without Eclipse and without stdout. Your test
 looks actually pretty similar to numerous other test cases that we've
 been using for a long time, e.g. the following one:


 https://github.com/BaseXdb/basex-tests/blob/master/src/test/java/org/basex/test/performance/ServerStressTest.java

 Maybe there's a small, but important difference that I missed by
 comparing the approaches?

 One more thought.. Have you done some testing with Java 6? I may be
 completely wrong, but I’m wondering if this bug is related to Java 7.
 We came across some other concurrency issues that did not happen with
 JDK/JRE 6 (some of which have already been fixed in the latest Java 7
 patches).

 Next, you could try to adjust the maximum number of parallel readers,
 and see what happens. This can be done by editing the .basex
 configuration file [1] and adjust the PARALLEL option [2]. If the
 error should persist when setting the number to 1, this could
 indicate that the problem is not related to our concurrency model, but
 the (un)locking of database files. In the past, we had similar
 problems with deleting and re-creating files. It may sound strange,
 but File.delete() won't always delete a file, even if there is no lock
 attached to it..

 Christian

 [1] http://docs.basex.org/wiki/Configuration#Configuration_Files
 [2] http://docs.basex.org/wiki/Options#PARALLEL

  -
 
 
  ..some first feedback: your example causes no problems when being run
  from the command line.
 
  However, I managed to reproduce the bug when running your example from
  within Eclipse. The error won’t occur when I suppress the dump to
  stdout, or forward it to a file.
 
  Two questions that might help to narrow down the issue:
 
  - did you also use for Eclipse for testing?
  - do you manage to reproduce the bug when running the example outside
  Eclipse?
  - what happens if you suppress the text output?
 
  Thanks,
  Christian
  ___
 
  On Wed, Sep 26, 2012 at 3:31 PM, Samuel Lacmene
  samuel.lacm...@buit-solutions.com wrote:
  Dear Christian,
 
  Thank you for the answer. I have tried to reproduce the BUG with the
 last
  Snapshot, but it still persists.
  So, I wrote a small example based on the factbook.xml, the bug occurred
 in
  the first 2 tests and then it has disappeared (See the example in the
  attachment).
 
  I have remarked that, to have more chance to see the BUG, you have to
 stop
  and start the basex-server and run the example.
 
  Best regards
  Samuel
 
 
  -Ursprüngliche Nachricht-
  Von: Christian Grün [mailto:christian.gr...@gmail.com]
  Gesendet: Montag, 24. September 2012 00:10
  An: samuel.lacm...@buit-solutions.com
  Betreff: Re: [basex-talk] BUG# Multiple Thread try to execute some Query
 
 
  Dear Samuel Lacmene ,
 
  sorry for the delay, and thanks for the bug report. First of all, I'd
  be interested if the bug persists with the latest stable snapshot [1]?
  If that should be the case, I'be glad if you could provide us with a
  small example [2] that allows us to reproduce the issue.
 
  Thanks in advance,
  Christian
 
  [1] http://files.basex.org/releases/latest/
  [2] http://sscce.org/

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


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


[basex-talk] Fwd: Usin Basex for Desktop Application

2012-04-26 Thread Lukas Kircher
Hi Anand,

forwarding this to the list ...

Regards,
Lukas

-- Forwarded message --
From: Anand Chiney anandc@gmail.com
Date: Thu, Apr 26, 2012 at 10:25 AM
Subject: Re: [basex-talk] Usin Basex for Desktop Application
To: Lukas Kircher lukaskirch...@googlemail.com


Hi Lukas,

I want to know about the *maximum number of documents* that can be stored
in the database
and *Max. Size per Document...

*I am planning to use baseX for my application which contains Resumes in
XML format as data.*
Also I am quite eager to know how will I UPDATE THE DB with new resumes.

*
Have a nice day
Regards
Anand
*
*

On Tue, Mar 27, 2012 at 2:54 PM, Lukas Kircher lukaskirch...@googlemail.com
 wrote:

 Hi,

 It's generally possible to use BaseX as a standalone application.
 You could start by taking a look at our local BaseX API examples
 [1] in our documentation.

 Feel free to contact us, if you need any assistance.

 Regards,
 Lukas

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



 On Tue, Mar 27, 2012 at 9:29 AM, Sandeep Yohans sandeepy@gmail.comwrote:

 Hello Sir/Madam,

 I am interested in using BaseX for my Desktop Application which I am
 developing using Java SE.

 Is it possible to use BaseX in a Desktop Application (Standalone
 Application) which will be installed on a computer with no internet
 connection or intranet?

 Looking forward to hear from you.

 --
 Sandeep Yohans

 Developer
 AIR Infotech
 Nagpur - India
 www.airinfotech.in


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





-- 
Regards


Have a nice day :)
Anand Chiney
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] Problem with BaseX inserting a namespace … how do I stop it

2012-04-03 Thread Lukas Kircher
Hi Mike,

thanks for the effort - this recreates the issue for me and
is certainly a bug, as you said. I'll have a look at it.

Regards,
Lukas



On Mon, Apr 2, 2012 at 6:01 PM, Mike Hawkes mikehaw...@me.com wrote:

 Hi

 A bit laborious to recreate but .. here goes:

 basexclient ... insert nodes then run:

  xquery /
 a
   b/
   d
 e test=here/
   /d
 /a
 Query executed in 0.2 ms.

 No problem - I see what I expect. Then run this:


  xquery insert node c{http:send-request( http method='get'
 status-only='false'/, http://internet.org.uk; ) }/c into /a

 Query executed in 502.05 ms.
  xquery /
 a
   b/
   d
 e test=here/
   /d
   c
 http:response xmlns:http=http://expath.org/ns/http-client;
 status=200 message=OK
 ...
 ... SNIPPED THE MIDDLE BODY OUT AS IT'S THE HTML RETURNED FROM THE SITE
 ...
   /c
 /a
 Query executed in 1.7 ms.


  xquery insert node f/ into /a/d


 Query executed in 1.34 ms.
  xquery /
 a
   b/
   d
 e test=here/
 f/
   /d
   c
 http:response xmlns:http=http://expath.org/ns/http-client;
 status=200 message=OK
   http:header name=Expires value=Mon, 26 Jul 1997 05:00:00 GMT/
   http:header name=Last-Modified value=Mon, 02 Apr 2012 15:47:39
 GMT/
   http:header name=Set-Cookie value=mosvisitor=1/
 ...
 ...
 ...
   /c
 /a
 Query executed in 1.72 ms.



  xquery delete node /a/d
 Query executed in 1.54 ms.

  xquery insert node d/ into /a

 Query executed in 1.56 ms.
  xquery insert node h test='hello'i//h into /a/d

 Query executed in 1.76 ms.
  xquery /
 a
   b/
   c
 http:response xmlns:http=http://expath.org/ns/http-client;
 status=200 message=OK
   http:header name=Expires value=Mon, 26 Jul 1997 05:00:00 GMT/
 ...
 ...
 ...
   /c
   d
 h xmlns=http://www.w3.org/1999/xhtml; test=hello
   i/
 /h
   /d
 /a
 Query executed in 1.71 ms.
 



 ---
 So, item 'h' suddenly gains a namespace.

 Sorry it's a bit convoluted to recreate, but it gets the results I see.

 Cheers
 Mike




 On 2 Apr 2012, at 16:18, Lukas Kircher wrote:

 Ok, I see the problem, unfortunately I still can't replicate the
 issue with our current repository version. I started with a
 document like this:

 *a b/ /a*

 and used the following insert statements:

 *insert node c xmlns='newns'/ into /a*

 and afterwards ...

 *insert node d/ into /a*
 *
 *
 *
 *
 Still, there's no namespace linked to d/. Can you replicate
 the issue with this example or change it in a way that it
 replicates it?

 Regards,
 Lukas




 On Mon, Apr 2, 2012 at 5:10 PM, Mike Hawkes mikehaw...@me.com wrote:

 Yep - this definitely causes problems. Insert a node that includes a
 namespace and all subsequent nodes end up with a namespace inserted. So ...
 I think this presents a bug:

 root
 nodes without namespace/
 new nodes work well/
 /root

 vs.

 root
 nodes without namespace/
 node with namespace/
 new nodes automatically get spurious namespace/
 /root


 Hope that helps - not sure how best to fix or work around this at the
 moment though.

 Cheers
 Mike

 On 2 Apr 2012, at 15:23, Mike Hawkes wrote:

 Hi Lukas/Christian

 It's the built-in one as far as I'm aware - I haven't done anything
 special to add or remove any parsers. But that's sent me down a path where
 I can get it reliably.

 It appears that it's coming from another query that I run to check the
 state of a web-site. As soon as I run the following query, BaseX inserts
 the namespace for every inserted node thereafter:

 insert node
 webpage url=http://internet.org.uk; name=primaryDomain{
 http:send-request(
 http:request
 method='get'
 status-only='false'/,
 http://internet.org.uk; )}
 /webpage
 into doc($DB)/root/webpages

 As soon as I have any node after the above query has run, BaseX inserts
 the namespace. Otherwise it doesn't. If I delete all the nodes within the
 webpage tags, things return to normal again.

 Is there an easy way to do the above without adding any namesakes (I
 don't actually want to include them from the web query either)? This should
 solve the problem.

 Cheers
 Mike

 On 2 Apr 2012, at 15:02, Lukas Kircher wrote:

 Hi Mike,

 Leo just came up with another idea: Which kind of parser are
 you using in BaseX?

 If you use the HTML parser for parsing XML, the strange behaviour
 you came across might indeed be expected ... If you're not sure
 which parser you are using, just take a look at our documentation [1].

 Regards,
 Lukas

 [1] http://docs.basex.org/wiki/Parser#XML_Parsers



 On Mon, Apr 2, 2012 at 3:58 PM, Mike Hawkes mikehaw...@me.com wrote:

 It's mad - I don't add a namespace, the source document is a text file
 without a namespace - and the log shows that I don't add it ... but it
 appears. No idea why.

 MIke

 On 2 Apr 2012, at 14:52, Christian Grün wrote:

  So it seems that the once added namespace is propagated to other
  documents? I believe there must be at least one document with the
  mentioned

Re: [basex-talk] Usin Basex for Desktop Application

2012-03-27 Thread Lukas Kircher
Hi,

It's generally possible to use BaseX as a standalone application.
You could start by taking a look at our local BaseX API examples
[1] in our documentation.

Feel free to contact us, if you need any assistance.

Regards,
Lukas

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



On Tue, Mar 27, 2012 at 9:29 AM, Sandeep Yohans sandeepy@gmail.comwrote:

 Hello Sir/Madam,

 I am interested in using BaseX for my Desktop Application which I am
 developing using Java SE.

 Is it possible to use BaseX in a Desktop Application (Standalone
 Application) which will be installed on a computer with no internet
 connection or intranet?

 Looking forward to hear from you.

 --
 Sandeep Yohans

 Developer
 AIR Infotech
 Nagpur - India
 www.airinfotech.in


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


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


Re: [basex-talk] nesting queries

2012-03-14 Thread Lukas Kircher
Hi Cerstin,


However, I am not sure if it is possible at all to mix displaying

(in the then part) and updating (in the else part)


True - that's actually a limitation of the update specification, wich
forbids
mixing updating and non-updating expressions. You can find some information
on it in our documentation [1] and in the actual XQuery specification [2].
As a consequence you have to insert the new query element during a
consecutive query.


If it is possible, I guess I have to include the name of the collection for
 insertion

by using db:open? Is it necessary to specify the exact place for insertion
 (as in

my example) as this should be already determined by the condition?


Declaring a variable via the Let expression would help to specify the exact
location only once ... but of course as you have to insert the node during
a second query it's not helping here.

Sorry that I can't provide you with a better solution ... feel free to ask
for more.


Best regards,
Lukas

[1] http://docs.basex.org/wiki/Update#Returning_Results
[2] http://www.w3.org/TR/xquery-update-10/#id-conditional-expr
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk