Re: [basex-talk] FW: minor issue in the project-view of BaseX-GUI with error marking

2016-01-12 Thread Christian Grün
Hi Rob,
I got it and fixed it [1]. Thanks for the notification.
Christian

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


On Wed, Jan 13, 2016 at 7:47 AM, Rob Stapper  wrote:
> And a posting to the list of course.
>
>
> -Oorspronkelijk bericht-
> Van: Rob Stapper [mailto:r.stap...@lijbrandt.nl]
> Verzonden: woensdag 13 januari 2016 7:31
> Aan: 'Christian Grün'
> Onderwerp: RE: [basex-talk] minor issue in the project-view of BaseX-GUI with 
> error marking
>
> Hi Christian,
>
> Here are two example files. It's pretty straight forward.
>
> Rob
>
> -Oorspronkelijk bericht-
> Van: Christian Grün [mailto:christian.gr...@gmail.com]
> Verzonden: dinsdag 12 januari 2016 17:54
> Aan: Rob Stapper
> CC: BaseX
> Onderwerp: Re: [basex-talk] minor issue in the project-view of BaseX-GUI with 
> error marking
>
> Hi Rob,
>
> If your xq file imports the xqm file, this is expected behavior: As long as 
> an imported module is not valid, the importing module cannot be parsed 
> either. If the xq file can be successfully run, just send me the two files, 
> and I’ll have a closer look.
>
> Christian
>
>
> On Tue, Jan 12, 2016 at 5:36 PM, Rob Stapper  wrote:
>> Hi,
>>
>> I found that when a directory contains both a program- and a
>> module-file with the same name but with different extensions ( .xq and
>> .xqm)
>>
>> both file are marked as erroneous in the project-view if only one
>> file, on my case the module-file, is indeed erroneous and the other file is 
>> ok.
>>
>> Regards,
>> Rob Stapper
>>
>> PS. It is my unittest-directory that contains both program- and
>> module-files.


Re: [basex-talk] Automatically generating test cases. Hidden feature?

2016-01-12 Thread Christian Grün
Hi Marc,

> BaseX, the gift that keeps on giving, thanks to all that make it possible.

One of the nicest compliments that we got so far… Thanks ;)

> So, a bit to my amazement, the following works:
>
> let $equals :=
>   %unit:test
>   function($a,$b) {
> unit:assert-equals($a,$b, 'Not equal')
>   }
> return
>   $equals(4,3)

Yes, it does, it will do so in the future. To add some more surprises:
You can omit the %unit:test annotation, because it’s the
unit:assert-equals function that raises the error in the XQUnit
namespace.

Cheers,
Christian


[basex-talk] FW: minor issue in the project-view of BaseX-GUI with error marking

2016-01-12 Thread Rob Stapper
And a posting to the list of course.


-Oorspronkelijk bericht-
Van: Rob Stapper [mailto:r.stap...@lijbrandt.nl] 
Verzonden: woensdag 13 januari 2016 7:31
Aan: 'Christian Grün'
Onderwerp: RE: [basex-talk] minor issue in the project-view of BaseX-GUI with 
error marking

Hi Christian,

Here are two example files. It's pretty straight forward.

Rob

-Oorspronkelijk bericht-
Van: Christian Grün [mailto:christian.gr...@gmail.com]
Verzonden: dinsdag 12 januari 2016 17:54
Aan: Rob Stapper
CC: BaseX
Onderwerp: Re: [basex-talk] minor issue in the project-view of BaseX-GUI with 
error marking

Hi Rob,

If your xq file imports the xqm file, this is expected behavior: As long as an 
imported module is not valid, the importing module cannot be parsed either. If 
the xq file can be successfully run, just send me the two files, and I’ll have 
a closer look.

Christian


On Tue, Jan 12, 2016 at 5:36 PM, Rob Stapper  wrote:
> Hi,
>
> I found that when a directory contains both a program- and a 
> module-file with the same name but with different extensions ( .xq and
> .xqm)
>
> both file are marked as erroneous in the project-view if only one 
> file, on my case the module-file, is indeed erroneous and the other file is 
> ok.
>
> Regards,
> Rob Stapper
>
> PS. It is my unittest-directory that contains both program- and 
> module-files.


test.xq
Description: Binary data


test.xqm
Description: Binary data


Re: [basex-talk] XML embedded in JSON

2016-01-12 Thread Imsieke, Gerrit, le-tex
Actual XML elements in actual JSON documents won’t be feasible I guess.
But after you’ve transformed the JSON to XML, you can parse the escaped
strings into XML elements proper, using
http://www.w3.org/TR/xpath-functions-3/#func-parse-xml

On 13.01.2016 02:06, E. Wray Johnson wrote:
> We have JSON that has string/text values which are XML.  Is there a
> way o have the XML as sub-elements value and not be encoded/escaped
> string?
> 
> Wray Johnson
> 


[basex-talk] XML embedded in JSON

2016-01-12 Thread E. Wray Johnson
We have JSON that has string/text values which are XML.  Is there a
way o have the XML as sub-elements value and not be encoded/escaped
string?

Wray Johnson


Re: [basex-talk] XQUF 3.0, MIXUPDATES

2016-01-12 Thread Hans-Juergen Rennau
Super, Christian, that's very helpful!
In order to make versatile tools *portable* (independent of .basex files on the 
tool user's machine), it would of course be great if sooner or later the XQUF 
3.0 will be supported. Such support would make the option obsolete, I think.
Cheers,Hans-Jürgen
 

Christian Grün  schrieb am 0:07 Mittwoch, 
13.Januar 2016:
 

 Hi Hans-Jürgen,

MIXUPDATES exists, it works, and it is used in practice. However, you
cannot specify it in the prolog of a query, because it also affects
imported modules. If you e.g. put MIXUPDATES=true in your .basex file,
you’ll see that you can mix updates and return values.

Hope this helps,
Christian


On Tue, Jan 12, 2016 at 11:34 PM, Hans-Juergen Rennau  wrote:
> Dear BaseX team,
>
> version 3.0 of the XQuery Update Facility (XQUF) allows expressions to
> perform an updating operation *and* return a value (e.g. [1]). Presently,
> BaseX supports probably only version 1.0 of the XQUF, so the mixing of
> update and value creates an error - and option MIXUPDATES equal "true" does
> not change this.:
>
> Query:
> ===
> declare option db:mixupdates 'true';
>
> 100,
> insert node  into *
> ===
> =>
> Stopped at C:/projects/act/updateQuery.xq, 5/1:
> [XUST0001] List expression: all expressions must be updating or return an
> empty sequence.
>
> In my opinion, the possibility to mix updating and value construction is
> very important, as otherwise it is impossible to develop versatile tools
> which may, dependent on call parameters, either return a result or perform
> an update.
>
> So my  Q U E S T I O N  is - are there already plans to support XQUF 3.0 -
> or as a first step the mixing of update and value - soon? Would be
> phantastic!
>
> Cheers,
> Hans-Jürgen
>
> [1] http://www.w3.org/TR/xquery-update-30/#id-comma-expr
> "The operand expressions of the comma expression are evaluated, and the XDM
> instances and pending update lists returned are concatenated in operand
> order. Pending update lists are concatenated by the upd:mergeUpdates
> operation."

  

Re: [basex-talk] XQUF 3.0, MIXUPDATES

2016-01-12 Thread Christian Grün
Hi Hans-Jürgen,

MIXUPDATES exists, it works, and it is used in practice. However, you
cannot specify it in the prolog of a query, because it also affects
imported modules. If you e.g. put MIXUPDATES=true in your .basex file,
you’ll see that you can mix updates and return values.

Hope this helps,
Christian


On Tue, Jan 12, 2016 at 11:34 PM, Hans-Juergen Rennau  wrote:
> Dear BaseX team,
>
> version 3.0 of the XQuery Update Facility (XQUF) allows expressions to
> perform an updating operation *and* return a value (e.g. [1]). Presently,
> BaseX supports probably only version 1.0 of the XQUF, so the mixing of
> update and value creates an error - and option MIXUPDATES equal "true" does
> not change this.:
>
> Query:
> ===
> declare option db:mixupdates 'true';
>
> 100,
> insert node  into *
> ===
> =>
> Stopped at C:/projects/act/updateQuery.xq, 5/1:
> [XUST0001] List expression: all expressions must be updating or return an
> empty sequence.
>
> In my opinion, the possibility to mix updating and value construction is
> very important, as otherwise it is impossible to develop versatile tools
> which may, dependent on call parameters, either return a result or perform
> an update.
>
> So my   Q U E S T I O N   is - are there already plans to support XQUF 3.0 -
> or as a first step the mixing of update and value - soon? Would be
> phantastic!
>
> Cheers,
> Hans-Jürgen
>
> [1] http://www.w3.org/TR/xquery-update-30/#id-comma-expr
> "The operand expressions of the comma expression are evaluated, and the XDM
> instances and pending update lists returned are concatenated in operand
> order. Pending update lists are concatenated by the upd:mergeUpdates
> operation."


Re: [basex-talk] Fulltext-Search: wildcards and thesaurus

2016-01-12 Thread Christian Grün
> is it possible to combine wildcards and thesaurus in a fulltext-search, for 
> example:

It is… But the exact semantics still need to be documented I guess.


Re: [basex-talk] How to get the complete list of full-text-index

2016-01-12 Thread Christian Grün
What did you try so far?

On Tue, Jan 12, 2016 at 9:49 PM, kleist  wrote:
> Perhaps I don't get it, that command gives me the number of a specific term? 
> But I need the list of all terms (with number of occurences).
>
> Best, Günter
>
>> Am 12.01.2016 um 21:39 schrieb Christian Grün :
>>
>>> is there any way to get the complete list of the full-text-index?
>>
>> Yes there is [1]. Check out all other functions in the Full-Text
>> Module; they may help you in various other situations.
>>
>> Cheers,
>> Christian
>>
>> [1] http://docs.basex.org/wiki/Full-Text_Module#ft:tokens
>>
>>
>> With the GUI I only get the first part:
>>>
>>> - Names:
>>> - Size: 5 MB
>>> - Entries: 23401
>>>  und   22662x
>>>  der   20595x
>>> 
>>>
>>> Thanks in advance.
>>>
>>> Best regards,
>>> Günter
>>
>
>


[basex-talk] Automatically generating test cases. Hidden feature?

2016-01-12 Thread Marc van Grootel
Hi,

Been a long time since posting. Work is very busy recently. Luckily
for me a lot of it involves XQuery ;-)

I am elaborating some examples [1] that show off the use of my Origami
[2] library. The most promising ones I will turn in to blog posts or a
wiki at some point.

Recently I've been reading a bit about generative testing (or
property-based testing) and libraries like Haskell's QuickCheck. I
hope to be able to show that we can use such techniques in combination
with RelaxNG and the concepts that Eric van der Vlist describes in
Examplotron [3] to mutate XML instances guided by a schema that I can
then turn into automatically generated tests.

It's still early days and time is limited but I did stumble onto
something interesting that I wanted to share here. If you already use
similar techniques I would be very interested to hear about it.

I was contemplating if it was possible to create anonymous unit test
functions that I can invoke with generated test input.

So, a bit to my amazement, the following works:

let $equals :=
  %unit:test
  function($a,$b) {
unit:assert-equals($a,$b, 'Not equal')
  }
return
  $equals(4,3)

This function raises the unit:UNIT0001 exception with the message
"Item 1: 3 expected, 4 returned". Cool!

So if this is possible can we also catch a failure and turn it into data?

let $equals :=
  %unit:test
  function($a,$b) {
unit:assert-equals($a,$b, 'Not equal')
  }
return
  try {
$equals(4,3)
  } catch * {

  { $err:code }
  { $err:description }
  { $err:value }
  { $err:module }
  { $err:line-number }
  { $err:column-number }

  }

This too works and produces an XML fragment recording the failure. Very cool!


  unit:UNIT0001
  Item 1: 3 expected, 4 returned.
  Not equal
  .../origami-examples/check/demo.xq
  23
  24


I am not sure if this a hidden or an intentional feature of the BaseX
unit module. I sure hope that it doesn't go away in future releases as
I intend to leverage this in an alternative testing module.

BaseX, the gift that keeps on giving, thanks to all that make it possible.

--Marc

[1] https://github.com/xokomola/origami-examples
[2] https://github.com/xokomola/origami
[3] http://examplotron.org/


[basex-talk] XQUF 3.0, MIXUPDATES

2016-01-12 Thread Hans-Juergen Rennau
Dear BaseX team,
version 3.0 of the XQuery Update Facility (XQUF) allows expressions to perform 
an updating operation *and* return a value (e.g. [1]). Presently, BaseX 
supports probably only version 1.0 of the XQUF, so the mixing of update and 
value creates an error - and option MIXUPDATES equal "true" does not change 
this.:
Query:===
declare option db:mixupdates 'true';

100,
insert node  into *
>Stopped at C:/projects/act/updateQuery.xq, 5/1:
[XUST0001] List expression: all expressions must be updating or return an empty 
sequence.

In my opinion, the possibility to mix updating and value construction is very 
important, as otherwise it is impossible to develop versatile tools which may, 
dependent on call parameters, either return a result or perform an update.
So my   Q U E S T I O N   is - are there already plans to support XQUF 3.0 - or 
as a first step the mixing of update and value - soon? Would be phantastic!

Cheers,Hans-Jürgen

[1] http://www.w3.org/TR/xquery-update-30/#id-comma-expr"The operand 
expressions of the comma expression are evaluated,and the XDMinstances and 
pending update lists returned areconcatenated in operand order. Pending update 
lists are concatenatedby the upd:mergeUpdates operation."

[basex-talk] Fulltext-Search: wildcards and thesaurus

2016-01-12 Thread kleist
Hi all, hi Christian,

is it possible to combine wildcards and thesaurus in a fulltext-search, for 
example:

contains text "nachricht.*" using wildcards using thesaurus at "thesaurus.xml"

Best regards,
Günter


Re: [basex-talk] How to get the complete list of full-text-index

2016-01-12 Thread kleist
Perhaps I don't get it, that command gives me the number of a specific term? 
But I need the list of all terms (with number of occurences).

Best, Günter

> Am 12.01.2016 um 21:39 schrieb Christian Grün :
> 
>> is there any way to get the complete list of the full-text-index?
> 
> Yes there is [1]. Check out all other functions in the Full-Text
> Module; they may help you in various other situations.
> 
> Cheers,
> Christian
> 
> [1] http://docs.basex.org/wiki/Full-Text_Module#ft:tokens
> 
> 
> With the GUI I only get the first part:
>> 
>> - Names:
>> - Size: 5 MB
>> - Entries: 23401
>>  und   22662x
>>  der   20595x
>> 
>> 
>> Thanks in advance.
>> 
>> Best regards,
>> Günter
> 




[basex-talk] How to get the complete list of full-text-index

2016-01-12 Thread kleist
Hi all, hi Christian

is there any way to get the complete list of the full-text-index? With the GUI 
I only get the first part:

- Names: 
- Size: 5 MB
- Entries: 23401
  und   22662x
  der   20595x


Thanks in advance.

Best regards,
Günter


Re: [basex-talk] How to get the complete list of full-text-index

2016-01-12 Thread Christian Grün
> is there any way to get the complete list of the full-text-index?

Yes there is [1]. Check out all other functions in the Full-Text
Module; they may help you in various other situations.

Cheers,
Christian

[1] http://docs.basex.org/wiki/Full-Text_Module#ft:tokens


 With the GUI I only get the first part:
>
> - Names:
> - Size: 5 MB
> - Entries: 23401
>   und   22662x
>   der   20595x
> 
>
> Thanks in advance.
>
> Best regards,
> Günter


Re: [basex-talk] XML Commands

2016-01-12 Thread Christian Grün
> How do you execute XML commands from the BaseX GUI?

What do you mean by "XML commands"? If you talk about BaseX commands,
you can use the input bar [1], or write command scripts [2] in the
editor. If you store your scripts with the .bxs suffix, it will be
executed as command script.

> Why can't multiple XML commands be executed from the BaseXClient.java?

You can. Just use several execute() calls.

> How can database options (e.g. autooptimize) be changed from the GUI without
> opening the database and locking it?

The "autooptimize" flag of a particular database can only be changed
by optimizing the database and setting the new flag. If you want to
avoid opening the database, you can use XQuery for that.

[1] http://docs.basex.org/wiki/GUI
[2] http://docs.basex.org/wiki/Commands#Command_Scripts


Re: [basex-talk] minor issue in the project-view of BaseX-GUI with error marking

2016-01-12 Thread Christian Grün
Hi Rob,

If your xq file imports the xqm file, this is expected behavior: As
long as an imported module is not valid, the importing module cannot
be parsed either. If the xq file can be successfully run, just send me
the two files, and I’ll have a closer look.

Christian


On Tue, Jan 12, 2016 at 5:36 PM, Rob Stapper  wrote:
> Hi,
>
> I found that when a directory contains both a program- and a module-file
> with the same name but with different extensions ( .xq and .xqm)
>
> both file are marked as erroneous in the project-view if only one file, on
> my case the module-file, is indeed erroneous and the other file is ok.
>
> Regards,
> Rob Stapper
>
> PS. It is my unittest-directory that contains both program- and
> module-files.


[basex-talk] XML Commands

2016-01-12 Thread E. Wray Johnson
How do you execute XML commands from the BaseX GUI?
Why can't multiple XML commands be executed from the BaseXClient.java?
How can database options (e.g. autooptimize) be changed from the GUI
without opening the database and locking it?


[basex-talk] minor issue in the project-view of BaseX-GUI with error marking

2016-01-12 Thread Rob Stapper
Hi,

 

I found that when a directory contains both a program- and a module-file
with the same name but with different extensions ( .xq and .xqm)

both file are marked as erroneous in the project-view if only one file, on
my case the module-file, is indeed erroneous and the other file is ok.

 

Regards,

Rob Stapper

 

PS. It is my unittest-directory that contains both program- and
module-files.



Re: [basex-talk] Adding basex-talk to markmail

2016-01-12 Thread Christian Grün
> I wasn't able to find basex-talk in markmail.org - a fantastic site for
> searching mailing list archives.  Would the list owners/administrators
> consider submitting this list to markmail?  Information about this can be
> found at http://markmail.org/docs/feedback.xqy.

Done; I’m waiting for their reply.

Thanks for the suggestion,
Christian


Re: [basex-talk] Fulltext Stemming

2016-01-12 Thread Christian Grün
Hi Günter,

You can play around with ft:normalize to see how the stemmer works:

  for $term in ('grün', 'Grüße')
  return {
ft:normalize($term, map {
  'language': 'German',
  'stemming': true()
})
  }

Here is a link to our German stemmer implementation [1]. Maybe there’s
some chance to extend it with a more sophisticated algorithm?
Suggestions are welcome.

Christian

[1] 
https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/ft/GermanStemmer.java



On Sun, Jan 10, 2016 at 5:54 PM, kleist  wrote:
> Hi all,
>
> with query options:
> contains text "grün" all using diacritics sensitive using stemming using 
> language 'German'
>
> I'll get: "grüne", "grüner", "Grüns" etc.
>
> But I also get  "Gruß", "Grüße", "grüßen" or something like "Gruner" 
> (Eigenname)
>
> Does the stemming have problems with german umlaute and "ß"?
>
> with query options:
> contains text "grün" all using stemming using language 'German'
> same results, but less. Why is that?
>
> The indexes of the database are the following:
> Indexes
>  Up-to-date: true
>  TEXTINDEX: true
>  ATTRINDEX: true
>  FTINDEX: true
>  TEXTINCLUDE:
>  ATTRINCLUDE:
>  FTINCLUDE:
>  LANGUAGE: German
>  STEMMING: true
>  CASESENS: true
>  DIACRITICS: true
>  STOPWORDS:
>  UPDINDEX: false
>  AUTOOPTIMIZE: false
>  MAXCATS: 100
>  MAXLEN: 96
>  INDEXSPLITSIZE: 0
>  FTINDEXSPLITSIZE: 0
>
> Optimized Query is the following:
> Optimized Query:
> let $hits_137 := ft:mark((db:open-pre("kleist-searchindex",147544), 
> ...)/(((descendant::tei:s union descendant::tei:l)))[descendant::text() 
> contains text "grün" all using diacritics sensitive using stemming using 
> language 'German']) return element div { (element p { ("grün") }, element p { 
> (count($hits_137)) }, element ul { (for $hit_139 in $hits_137 return element 
> li { 
> ($hit_139/descendant-or-self::node()/ancestor::tei:TEI/descendant-or-self::node()/tei:classCode[position()
>  = 1]/string(), $hit_139) }) }) }
>
> Best, Günter
>
>