Dear subscribers,
thanks for your continuing support! We are very pleased to announce BaseX 7.8 (the XMLPrague Edition). The new version was designed to further increase your productivity, no matter if you develop feature-rich XQuery applications or use BaseX as a light-weight XMLDB. You can expect the following great features:
* A new project view allows you to open, edit and manage your project files directly in the GUI and search files and contents in realtime.
* The integrated editor provides many new short cuts and code completions for writing XQuery modules.
* Delete and insert operations are executed faster than ever before, values are updated in-place whenever possible, and a new convenience operator has been added for transform expressions
* XQuery functions are now inlined and further optimized. Tail call detection and static typing has been improved, and (sub)sequences are processed much faster.
* Various XQuery Modules have been enhanced (JSON, CSV, Unit, Map, XQuery, Full-Text, EXPath File), and the EXPath Binary Module has been added
* BaseX is now available in Russian and Spanish. Thank you to Oleksandr Shpak and Carlos Marcos!
More details can be found in our documentation (http://docs.basex.org). We are looking forward to your feedback, and we hope to see many of you in Prague this Friday (http://lanyrd.com/2014/basex)!
Have fun,
Christian BaseX Team
Congrats! Looking forward to adopt it asap!
On 02/12/2014 05:00 PM, Christian Grün wrote:
Dear subscribers,
thanks for your continuing support! We are very pleased to announce BaseX 7.8 (the XMLPrague Edition). The new version was designed to further increase your productivity, no matter if you develop feature-rich XQuery applications or use BaseX as a light-weight XMLDB. You can expect the following great features:
- A new project view allows you to open, edit and manage your project
files directly in the GUI and search files and contents in realtime.
YEAH! Just a way to integrate with ANT for automizing a couple of tasks and I'd kick Eclipse off my toolchain for daily activity!
More details can be found in our documentation (http://docs.basex.org). We are looking forward to your feedback, and we hope to see many of you in Prague this Friday (http://lanyrd.com/2014/basex)!
Unable to be there but can't wait for your report and the presentations!
M.
Hi, I am trying to map a UUID to an OID according to: http://www.itu.int/ITU-T/asn1/uuid.html
I have the function below, but am getting error messages such as: [FORG0001] Invalid xs:integer cast: "204694913611445129843532382580231358684".
Any suggestions?
Cheers, -carl
declare namespace BI = "java:java.math.BigInteger”;
declare function uuid_oid() { let $uuid := translate(random:uuid(),'-','') let $bigInt := concat('2.25.',BI:new($uuid, xs:int(16) )) return $bigInt
};
Hi Carl,
Any suggestions?
there may be several solutions; one of them looks as follows:
let $uuid := xs:hexBinary(translate(random:uuid(),'-','')) let $bytes := convert:binary-to-bytes($uuid) ! xs:decimal(if(. < 0) then .+256 else .) return fold-left($bytes, 0, function($a, $b) { $a * 256 + $b })
Hope this helps, Christian
Cheers, -carl
declare namespace BI = "java:java.math.BigInteger";
declare function uuid_oid() { let $uuid := translate(random:uuid(),'-','') let $bigInt := concat('2.25.',BI:new($uuid, xs:int(16) )) return $bigInt
};
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Dear Christian, Thanks for that, it did the trick. I am curious what I was doing wrong with the BigInteger attempt? Cheers, -carl
On Feb 13, 2014, at 7:10 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Carl,
Any suggestions?
there may be several solutions; one of them looks as follows:
let $uuid := xs:hexBinary(translate(random:uuid(),'-','')) let $bytes := convert:binary-to-bytes($uuid) ! xs:decimal(if(. < 0) then .+256 else .) return fold-left($bytes, 0, function($a, $b) { $a * 256 + $b })
Hope this helps, Christian
Cheers, -carl
declare namespace BI = "java:java.math.BigInteger";
declare function uuid_oid() { let $uuid := translate(random:uuid(),'-','') let $bigInt := concat('2.25.',BI:new($uuid, xs:int(16) )) return $bigInt
};
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
For the record, what I ended up going with was: https://github.com/openhie/openinfoman/blob/master/repo/csd_base_library.xqm... Lines 14-26.
Cheers, -carl
On Feb 17, 2014, at 8:49 AM, Carl Leitner litlfred@ibiblio.org wrote:
Dear Christian, Thanks for that, it did the trick. I am curious what I was doing wrong with the BigInteger attempt? Cheers, -carl
On Feb 13, 2014, at 7:10 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Carl,
Any suggestions?
there may be several solutions; one of them looks as follows:
let $uuid := xs:hexBinary(translate(random:uuid(),'-','')) let $bytes := convert:binary-to-bytes($uuid) ! xs:decimal(if(. < 0) then .+256 else .) return fold-left($bytes, 0, function($a, $b) { $a * 256 + $b })
Hope this helps, Christian
Cheers, -carl
declare namespace BI = "java:java.math.BigInteger";
declare function uuid_oid() { let $uuid := translate(random:uuid(),'-','') let $bigInt := concat('2.25.',BI:new($uuid, xs:int(16) )) return $bigInt
};
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
For the record, what I ended up going with was: https://github.com/openhie/openinfoman/blob/master/repo/csd_base_library.xqm... Lines 14-26.
...interesting!
Thanks for that, it did the trick. I am curious what I was doing wrong with the BigInteger attempt?
Right now, xs:integer values in BaseX are limited to signed long values, which is compliant with the XQuery spec, but which is also why the Java conversion of BigInteger will yield invalid values. There could be ways to improve the situation:
a) raise errors when a Java value is too large to be converted to a BaseX XQuery item b) allow integers larger than long values by representing BaseX xs:integer values as internal BigInteger instances c) avoid Java calls whenever possible...
Personally, I generally tend to recommend c); not just because it means least effort for us, but also because it's not possible to define a 100% mapping between XQuery and Java data types. Nevertheless, in parallel, I'll also think a bit more about options a) and b).
Hope this helps, Christian
Cheers, -carl
On Feb 13, 2014, at 7:10 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Carl,
Any suggestions?
there may be several solutions; one of them looks as follows:
let $uuid := xs:hexBinary(translate(random:uuid(),'-','')) let $bytes := convert:binary-to-bytes($uuid) ! xs:decimal(if(. < 0) then .+256 else .) return fold-left($bytes, 0, function($a, $b) { $a * 256 + $b })
Hope this helps, Christian
Cheers, -carl
declare namespace BI = "java:java.math.BigInteger";
declare function uuid_oid() { let $uuid := translate(random:uuid(),'-','') let $bigInt := concat('2.25.',BI:new($uuid, xs:int(16) )) return $bigInt
};
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
On Feb 17, 2014, at 12:25 PM, Christian Grün christian.gruen@gmail.com wrote:
For the record, what I ended up going with was: https://github.com/openhie/openinfoman/blob/master/repo/csd_base_library.xqm... Lines 14-26.
...interesting!
Thanks for that, it did the trick. I am curious what I was doing wrong with the BigInteger attempt?
Right now, xs:integer values in BaseX are limited to signed long values, which is compliant with the XQuery spec, but which is also why
I thought that was for xs:int, but not xs:integer which is of arbitrary length. In other words: http://www.w3.org/TR/xmlschema11-2/#integer versus http://www.w3.org/TR/xmlschema11-2/#int
the Java conversion of BigInteger will yield invalid values. There could be ways to improve the situation:
a) raise errors when a Java value is too large to be converted to a BaseX XQuery item b) allow integers larger than long values by representing BaseX xs:integer values as internal BigInteger instances c) avoid Java calls whenever possible...
Personally, I generally tend to recommend c); not just because it means least effort for us, but also because it's not possible to define a 100% mapping between XQuery and Java data types. Nevertheless, in parallel, I'll also think a bit more about options a) and b).
Really all I needed for my use case was to call the toString() method on the BigInteger instance, but I couldn’t seem to do that without the implicit cast to xs:integer. What about something along the lines of: BI:new() returns a basex:binary as it’s type and leave it to the user to handle any explicit casting?
Hope this helps,
Yes. Thanks.
Christian
Cheers, -carl
On Feb 13, 2014, at 7:10 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Carl,
Any suggestions?
there may be several solutions; one of them looks as follows:
let $uuid := xs:hexBinary(translate(random:uuid(),'-','')) let $bytes := convert:binary-to-bytes($uuid) ! xs:decimal(if(. < 0) then .+256 else .) return fold-left($bytes, 0, function($a, $b) { $a * 256 + $b })
Hope this helps, Christian
Cheers, -carl
declare namespace BI = "java:java.math.BigInteger";
declare function uuid_oid() { let $uuid := translate(random:uuid(),'-','') let $bigInt := concat('2.25.',BI:new($uuid, xs:int(16) )) return $bigInt
};
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
I thought that was for xs:int, but not xs:integer which is of arbitrary length. In other words: http://www.w3.org/TR/xmlschema11-2/#integer versus http://www.w3.org/TR/xmlschema11-2/#int
It's true, the wording implies that all implementations need to support larger integers. This is in contrast with out-of-bounds situations resulting from integer operations (see e.g. [1] ("For xs:integer operations, implementations that support limited-precision integer operations ·must· select from the following options [...]").
Really all I needed for my use case was to call the toString() method on the BigInteger instance, but I couldn't seem to do that without the implicit cast to xs:integer. What about something along the lines of: BI:new() returns a basex:binary as it's type and leave it to the user to handle any explicit casting?
Maybe you can call BI:to-string() instead? Return basex:binary instead of casting the value could lead to unexpected behavior in existing applications..
Christian
For users on OS X using BaseX from within the package manager Homebrew [1]: my patch bumping BaseX to 7.8 just got merged [2].
You can upgrade using
brew update && brew upgrade basex
or install using
brew update && brew install basex
Regards, Jens
[1]: http://www.brew.sh [2]: https://github.com/Homebrew/homebrew/pull/26669
basex-talk@mailman.uni-konstanz.de