[basex-talk] example .basexperm files please

2013-01-02 Thread pw
hello list
are there any examples of .basexperm files?  what form are the
permissions in?  [i.e. 0777, or -rwxrwxrwx, or some other form] Is
the separator a space or a tab? [does it matter?]

thanks

Pete

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


Re: [basex-talk] Initial xquery for full text and geospatial search of ISO 19115 docs

2013-01-02 Thread Christian Grün
Check out our Wiki article on full-text processing to find out more:

  http://docs.basex.org/wiki/Full-Text
___

On Wed, Jan 2, 2013 at 11:17 PM, Christian Grün
 wrote:
> Hi David,
>
> due to the complexity of XQuery, it’s often a big challenge for the
> query optimizer to find out if an index can be used or not. This is
> the reason why some XML database don’t even try to rewrite queries for
> index access.
>
> What you can always do is: directly address the available index
> structures via the Full-Text and Index modules [1,2]. This will give
> you the guarantee that the index is indeed utilized.
>
> I'm sure there are also ways to rewrite your existing query in order
> to ensure index access, but I’d first need some more time to get into
> this. As a general note, you can help the optimizer by directly
> specifying the addressed database in your query. The following two
> examples may illustrate this. Query A und B will be optimized for
> index access, while Query C won’t (well, at least not in BaseX ≤ 7.5):
>
> Query A
>   db:open("db")//*[text() contains text { "A","B" }]
>
> Query B
>   let $terms := ("A", "B")
>   for $x in db:open("db")//*
>   where $x/text() contains text { $terms }
>   return $x
>
> Query C
>   declare function local:x($db, $terms) {
> db:open($db)//*[text() contains text { $terms }]
>};
>   let $terms := ("A", "B")
>   let $db := "db"
>   return local:x($db, $terms)
>
> Best,
> Christian
>
> [1] http://docs.basex.org/wiki/Full-Text_Module
> [2] http://docs.basex.org/wiki/Index_Module
> ___
>
> On Wed, Jan 2, 2013 at 10:59 PM, David Stuebe  wrote:
>>
>> Hi Chris
>>
>> I did look at the Query Info in the Gui and it seems you are correct. The
>> complex query I created is not utilizing the full text index.
>>
>> Details here:
>> https://gist.github.com/4438473
>>
>> The gist contains query info for the complex search that I created and for a
>> simple one that just executes the 'contains text' clause.
>>
>> The compile statement for the simple query includes the following line:
>> "applying full-text index"
>> The complex query does not…
>>
>>
>> So what to do now? How do I figure out why basex is not using the full text
>> index as the initial step in limiting the results of my search?
>>
>> Thanks
>>
>> David
>>
>>
>> From: "basex-talk-requ...@mailman.uni-konstanz.de"
>> 
>> Reply-To: "basex-talk@mailman.uni-konstanz.de"
>> 
>> Date: Tue, 1 Jan 2013 06:00:02 -0500
>> To: "basex-talk@mailman.uni-konstanz.de"
>> 
>> Subject: BaseX-Talk Digest, Vol 37, Issue 1
>>
>> Message: 1
>> Date: Mon, 31 Dec 2012 20:56:01 +0100
>> From: Christian Gr?n 
>> To: David Stuebe 
>> Cc: Kyle Wilcox ,
>> "basex-talk@mailman.uni-konstanz.de"
>> 
>> Subject: Re: [basex-talk] Initial xquery for full text and geospatial
>> search of ISO 19115 docs
>> Message-ID:
>> 
>> Content-Type: text/plain; charset=windows-1252
>>
>> Hi David,
>>
>> thanks for the insight into your project. It may be that the full-text
>> index is not utilized by your XQuery expression. Did you have a look
>> at the query info (e.g. via GUI, InfoView, or -V on command line)? Did
>> you manage to write simpler queries that are processed faster?
>>
>> Best,
>> Christian
>> ___
>>
>> On Mon, Dec 31, 2012 at 7:31 PM, David Stuebe 
>> wrote:
>>
>>
>>
>>
>> Hi Basex Folks
>>
>> I have written a simple minded xquery script which can be used in a post to
>> search ISO 19115 metadata documents.
>> As I am a newbie to xquery and basex I expect that is much that I could do
>> to improve performance, but currently searches take up to 15 seconds. The
>> server hardware is not blazing fast and we are running inside tomcat? but
>> that is certainly not acceptable for a database which is still quiet small.
>> Initially it was fine, responding in less than a second, but when we
>> expanded from less than 100 docs to about 35000 the time grew at least
>> linearly. I am hoping this is due to my poor xquery programming or a setting
>> on the server.
>>
>> Here is the query we are running using a post request with the declared
>> variables at the bottom filled in by the UI:
>> https://github.com/asascience-open/glos_catalog/blob/master/queries/full_search.xml
>>
>> Here are some of the ISO xml documents that we have in our basex DB:
>> https://github.com/asascience-open/glos_catalog/tree/master/ISOs
>>
>> It is used by this site: http://explorer.glos.us/
>> To provide geospatial metadata search. Fill in a text value like "water" or
>> "temperature" in the search box in the top right?
>>
>> The server is here: http://64.9.200.113:8080/BaseX73/
>> User Name: user
>> Password: glos
>> ACL: read only
>>
>>
>> I am hoping it is as simple as a setting on the basex server. Here is the
>> current server info:
>>
>> info database
>> Database Properties
>>   Name: glos
>>   Size: 422 MB
>>   Nodes: 17045388
>>   Documents: 34922
>>   Binaries: 0
>>   Tim

Re: [basex-talk] Initial xquery for full text and geospatial search of ISO 19115 docs

2013-01-02 Thread Christian Grün
Hi David,

due to the complexity of XQuery, it’s often a big challenge for the
query optimizer to find out if an index can be used or not. This is
the reason why some XML database don’t even try to rewrite queries for
index access.

What you can always do is: directly address the available index
structures via the Full-Text and Index modules [1,2]. This will give
you the guarantee that the index is indeed utilized.

I'm sure there are also ways to rewrite your existing query in order
to ensure index access, but I’d first need some more time to get into
this. As a general note, you can help the optimizer by directly
specifying the addressed database in your query. The following two
examples may illustrate this. Query A und B will be optimized for
index access, while Query C won’t (well, at least not in BaseX ≤ 7.5):

Query A
  db:open("db")//*[text() contains text { "A","B" }]

Query B
  let $terms := ("A", "B")
  for $x in db:open("db")//*
  where $x/text() contains text { $terms }
  return $x

Query C
  declare function local:x($db, $terms) {
db:open($db)//*[text() contains text { $terms }]
   };
  let $terms := ("A", "B")
  let $db := "db"
  return local:x($db, $terms)

Best,
Christian

[1] http://docs.basex.org/wiki/Full-Text_Module
[2] http://docs.basex.org/wiki/Index_Module
___

On Wed, Jan 2, 2013 at 10:59 PM, David Stuebe  wrote:
>
> Hi Chris
>
> I did look at the Query Info in the Gui and it seems you are correct. The
> complex query I created is not utilizing the full text index.
>
> Details here:
> https://gist.github.com/4438473
>
> The gist contains query info for the complex search that I created and for a
> simple one that just executes the 'contains text' clause.
>
> The compile statement for the simple query includes the following line:
> "applying full-text index"
> The complex query does not…
>
>
> So what to do now? How do I figure out why basex is not using the full text
> index as the initial step in limiting the results of my search?
>
> Thanks
>
> David
>
>
> From: "basex-talk-requ...@mailman.uni-konstanz.de"
> 
> Reply-To: "basex-talk@mailman.uni-konstanz.de"
> 
> Date: Tue, 1 Jan 2013 06:00:02 -0500
> To: "basex-talk@mailman.uni-konstanz.de"
> 
> Subject: BaseX-Talk Digest, Vol 37, Issue 1
>
> Message: 1
> Date: Mon, 31 Dec 2012 20:56:01 +0100
> From: Christian Gr?n 
> To: David Stuebe 
> Cc: Kyle Wilcox ,
> "basex-talk@mailman.uni-konstanz.de"
> 
> Subject: Re: [basex-talk] Initial xquery for full text and geospatial
> search of ISO 19115 docs
> Message-ID:
> 
> Content-Type: text/plain; charset=windows-1252
>
> Hi David,
>
> thanks for the insight into your project. It may be that the full-text
> index is not utilized by your XQuery expression. Did you have a look
> at the query info (e.g. via GUI, InfoView, or -V on command line)? Did
> you manage to write simpler queries that are processed faster?
>
> Best,
> Christian
> ___
>
> On Mon, Dec 31, 2012 at 7:31 PM, David Stuebe 
> wrote:
>
>
>
>
> Hi Basex Folks
>
> I have written a simple minded xquery script which can be used in a post to
> search ISO 19115 metadata documents.
> As I am a newbie to xquery and basex I expect that is much that I could do
> to improve performance, but currently searches take up to 15 seconds. The
> server hardware is not blazing fast and we are running inside tomcat? but
> that is certainly not acceptable for a database which is still quiet small.
> Initially it was fine, responding in less than a second, but when we
> expanded from less than 100 docs to about 35000 the time grew at least
> linearly. I am hoping this is due to my poor xquery programming or a setting
> on the server.
>
> Here is the query we are running using a post request with the declared
> variables at the bottom filled in by the UI:
> https://github.com/asascience-open/glos_catalog/blob/master/queries/full_search.xml
>
> Here are some of the ISO xml documents that we have in our basex DB:
> https://github.com/asascience-open/glos_catalog/tree/master/ISOs
>
> It is used by this site: http://explorer.glos.us/
> To provide geospatial metadata search. Fill in a text value like "water" or
> "temperature" in the search box in the top right?
>
> The server is here: http://64.9.200.113:8080/BaseX73/
> User Name: user
> Password: glos
> ACL: read only
>
>
> I am hoping it is as simple as a setting on the basex server. Here is the
> current server info:
>
> info database
> Database Properties
>   Name: glos
>   Size: 422 MB
>   Nodes: 17045388
>   Documents: 34922
>   Binaries: 0
>   Timestamp: 27.12.2012 00:58:03
>
> Resource Properties
>   Timestamp: 22.12.2012 01:43:05
>   Encoding: UTF-8
>   Whitespace Chopping: ON
>
> Indexes
>   Up-to-date: true
>   Text Index: ON
>   Attribute Index: ON
>   Full-Text Index: ON
>
> The index info is available here:
> https://github.com/asascience-open/glos_catalog/blob/master/queries/glos_index_info.txt
>
>
>
> David

Re: [basex-talk] Initial xquery for full text and geospatial search of ISO 19115 docs

2013-01-02 Thread David Stuebe

Hi Chris

I did look at the Query Info in the Gui and it seems you are correct. The 
complex query I created is not utilizing the full text index.

Details here:
https://gist.github.com/4438473

The gist contains query info for the complex search that I created and for a 
simple one that just executes the 'contains text' clause.

The compile statement for the simple query includes the following line: 
"applying full-text index"
The complex query does not…


So what to do now? How do I figure out why basex is not using the full text 
index as the initial step in limiting the results of my search?

Thanks

David


From: 
"basex-talk-requ...@mailman.uni-konstanz.de"
 
mailto:basex-talk-requ...@mailman.uni-konstanz.de>>
Reply-To: 
"basex-talk@mailman.uni-konstanz.de" 
mailto:basex-talk@mailman.uni-konstanz.de>>
Date: Tue, 1 Jan 2013 06:00:02 -0500
To: 
"basex-talk@mailman.uni-konstanz.de" 
mailto:basex-talk@mailman.uni-konstanz.de>>
Subject: BaseX-Talk Digest, Vol 37, Issue 1

Message: 1
Date: Mon, 31 Dec 2012 20:56:01 +0100
From: Christian Gr?n 
mailto:christian.gr...@gmail.com>>
To: David Stuebe mailto:dstu...@asascience.com>>
Cc: Kyle Wilcox mailto:kwil...@asascience.com>>,

"basex-talk@mailman.uni-konstanz.de"

mailto:basex-talk@mailman.uni-konstanz.de>>
Subject: Re: [basex-talk] Initial xquery for full text and geospatial
search of ISO 19115 docs
Message-ID:

mailto:cap94bnpneuwgumgl-k2zmw6gcd4wqnc82kbr5es8h+brz1f...@mail.gmail.com>>
Content-Type: text/plain; charset=windows-1252

Hi David,

thanks for the insight into your project. It may be that the full-text
index is not utilized by your XQuery expression. Did you have a look
at the query info (e.g. via GUI, InfoView, or -V on command line)? Did
you manage to write simpler queries that are processed faster?

Best,
Christian
___

On Mon, Dec 31, 2012 at 7:31 PM, David Stuebe 
mailto:dstu...@asascience.com>> wrote:



Hi Basex Folks

I have written a simple minded xquery script which can be used in a post to
search ISO 19115 metadata documents.
As I am a newbie to xquery and basex I expect that is much that I could do
to improve performance, but currently searches take up to 15 seconds. The
server hardware is not blazing fast and we are running inside tomcat? but
that is certainly not acceptable for a database which is still quiet small.
Initially it was fine, responding in less than a second, but when we
expanded from less than 100 docs to about 35000 the time grew at least
linearly. I am hoping this is due to my poor xquery programming or a setting
on the server.

Here is the query we are running using a post request with the declared
variables at the bottom filled in by the UI:
https://github.com/asascience-open/glos_catalog/blob/master/queries/full_search.xml

Here are some of the ISO xml documents that we have in our basex DB:
https://github.com/asascience-open/glos_catalog/tree/master/ISOs

It is used by this site: http://explorer.glos.us/
To provide geospatial metadata search. Fill in a text value like "water" or
"temperature" in the search box in the top right?

The server is here: http://64.9.200.113:8080/BaseX73/
User Name: user
Password: glos
ACL: read only


I am hoping it is as simple as a setting on the basex server. Here is the
current server info:

info database
Database Properties
  Name: glos
  Size: 422 MB
  Nodes: 17045388
  Documents: 34922
  Binaries: 0
  Timestamp: 27.12.2012 00:58:03

Resource Properties
  Timestamp: 22.12.2012 01:43:05
  Encoding: UTF-8
  Whitespace Chopping: ON

Indexes
  Up-to-date: true
  Text Index: ON
  Attribute Index: ON
  Full-Text Index: ON

The index info is available here:
https://github.com/asascience-open/glos_catalog/blob/master/queries/glos_index_info.txt



David Stuebe

Scientist & Software Engineer ? RPS ASA

55 Village Square Drive
South Kingstown, RI 02879-8248

Tel: +1 (401) 789-6224

Email: david.stu...@rpsgroup.com
www: asascience.com | rpsgroup.com

A member of the RPS Group plc


___
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] Fwd: concat string in for loop

2013-01-02 Thread Christian Grün
Cześć, Jaroslwy,

as XML serialization was originally not built for outputting text, the
handling of whitespaces is a little tricky. However, you can benefit
from the new XQuery 3.0 "item-separator" output option:

  declare option output:item-separator '\n';
  concat("text",'
',"additional text"),
  element-aelement-b/*/string()

If you want to stick with XQuery 1.0, you can try string-join():

string-join((
  "text", "additional text",
  element-aelement-b/*
), '
')
___

On Wed, Jan 2, 2013 at 9:58 PM, Jarosław Kowalewski
 wrote:
> Hi,
>
> I've a problem with concatation strings in for loop.
>
> e.g. xquery
>
>
> concat("text",'
',"additional text"),
> '
',
> '
',
>
> for $i in element-aelement-b/*
> return concat($i,'
')
>
>
> give me the result
>
> "
> text
> additional text
>
>  element-a
>  element-b
> "
>
> with additional space before "element-a" and "element-b" but the
> concatation in the first row works fine. I tried it in GUI mode
> version 7.3 and 7.5.
>
> Jarek
> ___
> 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] TR: how to know creation options of a database

2013-01-02 Thread Christian Grün
Hi Fabrice,

> Do you still plan to increase database node count limitation for the next 
> major version ?

it’s on our agenda, but among hundreds of other more pressing issues,
so… don’t expect this too soon.
___

>
> Good night
>
> -Message d'origine-
> De : Christian Grün [mailto:christian.gr...@gmail.com]
> Envoyé : mercredi 2 janvier 2013 21:34
> À : Fabrice Etanchaud
> Cc : basex-talk@mailman.uni-konstanz.de
> Objet : Re: [basex-talk] how to know creation options of a database
>
> Dear Fabrice,
>
>> How can I know the creation options of a given database ?
>>
>> When I open a database created with a few non default options (MAXCATS
>> set to 1) for example,
>>
>> GET MAXCATS seems to  always return the last value set with SET MAXCATS.
>
> good point, there was no way to do so.. but this has changed with the latest 
> snapshot. You will get the value for UPDINDEX, MAXCATS and MAXLEN by either 
> running the commands "open ...; info db" or evaluating the XQuery function 
> "db:info('...')".
>
> The GET command will always give you the global value of an option.
>
> Thanks,
> Christian
> ___
> 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: concat string in for loop

2013-01-02 Thread Jarosław Kowalewski
Hi,

I've a problem with concatation strings in for loop.

e.g. xquery


concat("text",'
',"additional text"),
'
',
'
',

for $i in element-aelement-b/*
return concat($i,'
')


give me the result

"
text
additional text

 element-a
 element-b
"

with additional space before "element-a" and "element-b" but the
concatation in the first row works fine. I tried it in GUI mode
version 7.3 and 7.5.

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


[basex-talk] TR: how to know creation options of a database

2013-01-02 Thread Fabrice Etanchaud
Thank you once again Christian for your fast reply, and update !

BaseX is a fantastic XML tool.
Wondering how I could process XML before !

As night time is also dream time,
Do you still plan to increase database node count limitation for the next major 
version ?

Good night

-Message d'origine-
De : Christian Grün [mailto:christian.gr...@gmail.com] 
Envoyé : mercredi 2 janvier 2013 21:34
À : Fabrice Etanchaud
Cc : basex-talk@mailman.uni-konstanz.de
Objet : Re: [basex-talk] how to know creation options of a database

Dear Fabrice,

> How can I know the creation options of a given database ?
>
> When I open a database created with a few non default options (MAXCATS 
> set to 1) for example,
>
> GET MAXCATS seems to  always return the last value set with SET MAXCATS.

good point, there was no way to do so.. but this has changed with the latest 
snapshot. You will get the value for UPDINDEX, MAXCATS and MAXLEN by either 
running the commands "open ...; info db" or evaluating the XQuery function 
"db:info('...')".

The GET command will always give you the global value of an option.

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


Re: [basex-talk] Either db:replace() or I had too much to drink this XMas

2013-01-02 Thread Christian Grün
;) ..hi France,

it may take us a while to reproduce what’s going on in your code, so..
do you think you could further simplify your example? Or, ideally,
minimize it to a simple db:replace() function?

> Note: If I use db:optimize('en-us', true()), I get 'unexpected error: 0'

You could check the consistency of your database via the INSPECT
command [1] before and after running your query.

Thanks,
Christian

[1] http://docs.basex.org/wiki/Commands#INSPECT
___

> To replicate: you'll need a db named 'en-us' with the 3 following documents
> (file names don't matter):
>
> 
> 
> 
>
> Then use these functions:
>
>
> declare %rest:path("/admin/refresh-menu-headings")
>%rest:GET
>%rest:query-param("menu-id", "{$menu-id}", "devicehelp")
>updating function admin:refresh-menu-headings($menu-id as xs:string){
>
>   (:Get the content:)
>let $raw-menu := app:open-db('en-us')/menu[@id = $menu-id]
>
>   (:Get the file location:)
>let $menu-uri := substring-after($raw-menu/base-uri(), 'en-us/')
>
>   (:Copy the content:)
> let $menu := $raw-menu
>
>(:Output the content in a file to ensure you have the right one:)
>
>let $debug := file:write('debug-ouch.xml', document{$menu})
>
>   (:Output the file uri to ensure you have the right one:)
>
> let $debug-uri := file:write('debug-uri.xml', $menu-uri)
>
>(:Replace the content of the file with the same content that was
> outputted in debug-ouch:)
>
> return (db:replace('en-us', $menu-uri, $menu),
>
> db:output(/restxq/admin/success/heading-refresh))
>
> };
>
>
> declare %rest:path('/admin/success/heading-refresh')
> updating function admin:success-heading-refresh(){
> let $result := http://www.w3.org/1999/xhtml";>
>Add headings to menu
> topicrefs
>
>   Add headings to menu topicrefs
>   
>  Menus were
> updated successfully.
>   
>
>   
>return (db:optimize('en-us'), db:output($result))
>
>
>
> RESULT:
> The result after optimize if your query for a list of the /menu/data(@id)
> should be devicehelp, smbonly, ptt-help, but it's ptt-help, smbonly,
> ptt-help.
>
> debug-ouch.xml shows the correct content (content of menu devicehelp),
> debug-uri shows the right file path (path of menu ptt-help), yet the content
> of menu with @id devicehelp gets replaced by the content of menu with
> @id=ptt-help after db:replace.
>
> Note: If I use db:optimize('en-us', true()), I get 'unexpected error: 0'
>
> --
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com
> (514) 572-0341
> ___
> 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

2013-01-02 Thread Christian Grün
Since Version 7.5, you can specify globally valid options via system properties:

  http://docs.basex.org/wiki/Options
___

On Wed, Jan 2, 2013 at 8:10 PM,   wrote:
> Hello List
>
> I am working with 7.5 and am looking for guidance on setting UPDINDEX
>
> If I run the basex http server from the command line and GET UPDINDEX
> it is initially false.  If I then open the client and GET UPDINDEX it
> is also false (as expected).  Through the client I can then set it
> with the command "set updindex true".  This time GET UPDINDEX returns
> true through the client but false through the httpserver.
>
> How do I set the updindex option so that it it operational for the
> REST service?
>
> Thanks
>
> Peter
>
> ___
> 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] how to know creation options of a database

2013-01-02 Thread Christian Grün
Dear Fabrice,

> How can I know the creation options of a given database ?
>
> When I open a database created with a few non default options (MAXCATS set
> to 1) for example,
>
> GET MAXCATS seems to  always return the last value set with SET MAXCATS.

good point, there was no way to do so.. but this has changed with the
latest snapshot. You will get the value for UPDINDEX, MAXCATS and
MAXLEN by either running the commands "open ...; info db" or
evaluating the XQuery function "db:info('...')".

The GET command will always give you the global value of an option.

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


Re: [basex-talk] http server ... outsider localhost

2013-01-02 Thread Christian Grün
..done; thanks Andy, thanks Peter.
___

On Wed, Jan 2, 2013 at 1:58 PM, Andy Bunce  wrote:
> Peter,
>  Good to know it worked.
> Christian,
>  I think this change should be made to the github source
>
> /Andy
>
> On Tue, Jan 1, 2013 at 2:00 AM,  wrote:
>>
>> Andy
>> changing the default to 0.0.0.0 worked.  Many thanks
>>
>> Peter
>>
>>
>>  Original Message 
>> From: bunce.a...@gmail.com
>> To: p...@themail.co.uk
>> Subject: Re: [basex-talk] http server ... outsider localhost
>> Date: Mon, 31 Dec 2012 11:34:48 +
>>
>> >Hi Peter,
>> >I wonder if this problem is related to a change I suggested to the
>> >webapps/WEB_INF/jetty.xml file.
>> >Do you still get the problem if you remove the line below and
>> >restart?
>> >> >default=""/>
>> >
>> >Or if you change default="" to default="0.0.0.0" as suggested here
>> >
>> >http://osgeo-org.1560.n6.nabble.com/Cannot-connect-to-server-host-IP-
>> >unless-it-s-localhost-td3861103.html
>> >
>> >Regards
>> >
>> >/Andy
>> >
>> >On Sun, Dec 30, 2012 at 5:30 PM,  wrote:
>> >
>> >> Hi Christian
>> >>
>> >> I just downloaded the BaseX 7.5 zip archive and ran the
>> >> httpserver.bat file ... On the local machine I was able to access
>> >> using the localhost or machine name as URLs, but access from
>> >> elsewhere on the network got to the Jetty server (it logged "access
>> >> denied") but apparently no further.
>> >>
>> >> Peter
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Hi Peter,
>> >>
>> >> the combination of BaseX and Jetty is successfully applied in many
>> >> productive client/server environments. Can you provide us with some
>> >> more details on how to reproduce the issue?
>> >>
>> >>
>> >> Thanks,
>> >> Christian
>> >> ___
>> >>
>> >> > hello list --- Happy Christmas & New Year
>> >> >
>> >> > If I run the http server (Basex 7.5) then I can access through
>> >> Jetty.
>> >> > When I try to access the same across the network I get nothing
>> >> > through and "Access denied" in the Basex logs. What's the
>> >solution?
>> >> >
>> >> > Many thanks
>> >> > Peter
>> >> >
>> >> > ___
>> >> > 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 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] Either db:replace() or I had too much to drink this XMas

2013-01-02 Thread France Baril
Hi, I am having issues with updating functions in BaseX 7.5 (official
release).


When I update a document, its content is updated with the content of
another document.


I even perform the db:optimized in a separate function after a forward to
ensure that the db:replace is in fact completed before indexes are
optimized.

*
*

To replicate: you'll need a db named 'en-us' with the 3 following documents
(file names don't matter):





Then use these functions:

*
*

*declare* %rest:path("/admin/refresh-menu-headings")
   %rest:GET
   %rest:query-param("menu-id", "{$menu-id}", "devicehelp")
   *updating* *function* *admin:refresh-menu-headings*(*$menu-id* *as **
xs:string*){

  (:Get the content:)
   *let* *$raw-menu* := *app:open-db*('en-us')/*menu*[*@id* = *$menu-id*
]

  (:Get the file location:)
   *let* *$menu-uri* := *substring-after*(*$raw-menu*/*base-uri*(),
'en-us/')

  (:Copy the content:)
*let* *$menu* := *$raw-menu*

*   (:Output the content in a file to ensure you have the right one:)*

*   **let* *$debug* := *file:write*('debug-ouch.xml', *document*{*$menu*
})

  (:Output the file uri to ensure you have the right one:)

*let* *$debug-uri* := *file:write*('debug-uri.xml', *$menu-uri*)

   (:Replace the content of the file with the same content that was
outputted in debug-ouch:)
*return *(*db:replace*('en-us', *$menu-uri*, *$menu*),
  *db:output*(
/restxq/admin/success/heading-refresh))

};


*declare* %rest:path('/admin/success/heading-refresh')
*updating* *function* *admin:success-heading-refresh*(){
*let **$result* := http://www.w3.org/1999/xhtml"*>
   Add headings to menu topicrefs

   
  Add headings to menu topicrefs
  
 Menus were
updated successfully.
  
   
  
   *return *(*db:optimize*('en-us'), *db:output*(*$result*))


RESULT:
The result after optimize if your query for a list of the /menu/data(@id)
should be devicehelp, smbonly, ptt-help, but it's ptt-help, smbonly,
ptt-help.

debug-ouch.xml shows the correct content (content of menu devicehelp),
debug-uri shows the right file path (path of menu ptt-help), yet the
content of menu with @id devicehelp gets replaced by the content of menu
with @id=ptt-help after db:replace.

Note: If I use db:optimize('en-us', true()), I get 'unexpected error: 0'

-- 
France Baril
Architecte documentaire / Documentation architect
france.ba...@architextus.com
(514) 572-0341
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] UPDINDEX

2013-01-02 Thread pw
Hello List

I am working with 7.5 and am looking for guidance on setting UPDINDEX

If I run the basex http server from the command line and GET UPDINDEX
it is initially false.  If I then open the client and GET UPDINDEX it
is also false (as expected).  Through the client I can then set it
with the command "set updindex true".  This time GET UPDINDEX returns
true through the client but false through the httpserver.  

How do I set the updindex option so that it it operational for the
REST service?

Thanks

Peter

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


Re: [basex-talk] how to pass raw bytes intact?

2013-01-02 Thread Christian Grün
As Liam indicated (thanks!), XQuery may not be the best choice to
process data on byte level: XQuery was built to work with Unicode
characters as basic unit, which means that it will never be possible
with pure XQuery to create illegal UTF8 sequences. This also means
that the language provides no support to „repair” invalid input.

I wonder if you have enough control over your input to avoid UTF8
shattering? If there’s no choice, and if you still want to try
XQuery/BaseX for byte processing, you can play around with the
functions of the Conversion Module:

  http://docs.basex.org/wiki/Conversion_Module
___

On Tue, Jan 1, 2013 at 5:50 AM,   wrote:
>> "LREQ" == Liam R E Quin  writes:
> LREQ> Treating the individual UTF-8 octets individually?
> Yes.
> LREQ> Not in standard XQuery, but that doesn't preclude a BaseX extension...
> Well no big deal, I was just curious.
>>> I was just curious if there was a way in basex if I could do s!!!g
>>> like I can do in perl, to restore the damaged UTF-8 characters.
>
> LREQ> Note that "damaged UTF-8 characters", if by that you mean not
> LREQ> well-formed UTF-8, aren't going to come through email reliably, so I
> LREQ> might not be seeing what you wrote - s!!!g can be done with
>
> Don't worry. I wouldn't put any illegal chars into mail.
>
> LREQ> replace() but getting at UTF-8-encoded characters one octet at a time is
> LREQ> another matter. But, my goal in replying was to tease out enough
> LREQ> information from you that someone else could answer :-)
>
>>> http://www.couchsurfing.org/group_read.html?gid=430&post=13998575
> LREQ> This says, "this thread has been deleted" at me.
> In fact they deleted the entire group it turns out.
>
> Anyway here's what I posted there
> #!/usr/bin/perl
> # Shows line where we remove couchsurfing.org's UTF-8 shattering effects.
> # Must run this before the browser gets its hands on it and turns the
> # shattered UTF-8 into U+FFFD REPLACEMENT CHARACTER.
> # So that seems to count out greasemonkey, etc. solutions.
> # I used wwwoffle -o URL|./this_program after first browsing the page logged 
> in
> # in a browser that used wwwoffle as a proxy
> # Copyright   : http://www.fsf.org/copyleft/gpl.html
> # Author  : Dan Jacobson -- http://jidanni.org/
> # Created On  : 12/31/2012
> # Last Modified On: Mon Dec 31 13:12:57 2012
> # Update Count: 27
> use strict;
> use warnings FATAL => 'all';
> my $N = qr/[^[:ascii:]]/;
> while (<>) {
> my $original_line = $_;
> ## needed on e.g., http://www.couchsurfing.org/couchmanager?read=18541584
> s!!!g;
> ## needed on e.g.,
> ## 
> http://www.couchsurfing.org/couchrequest/show_couchoffer_form?city_couchrequest=1223052
> s!($N) ($N)!$1$2!g;
> s!\t\s+!! && chomp;
> m!^\s+... \(more\) ! && next;
> s!\s* !!;
> print "$.: $_" if $_ ne $original_line;
> }
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] XQuery Update using IF Condition...

2013-01-02 Thread Christian Grün
Hi John,

all branches of your if expression must be updating, or return an
empty sequence. In the latest snapshot [1], I’ve replaced the old
error message with a more helpful one (“all expressions must be
updating or return an empty sequence.”).

To come back to your query: The following query will be accepted:

  for $c in doc('2012')/Docs/Doc/No/@n
  return
if(doc('Data')/Docs/Doc[No/@n=$c]/Title/Name/text())
then insert node $c into doc('Data')/Docs
else ()

The following query does the same:

  for $c in doc('2012')/Docs/Doc/No/@n
  where doc('Data')/Docs/Doc[No/@n=$c]/Title/Name/text()
  return insert node $c into doc('Data')/Docs

If you want to return some textual output for all nodes that have not
been updated, you can use db:output() [2]:

  for $c in doc('2012')/Docs/Doc/No/@n
  return
if(doc('Data')/Docs/Doc[No/@n=$c]/Title/Name/text())
then insert node $c into doc('Data')/Docs
else db:output({''})

Hope this helps,
Christian

[1] http://files.basex.org/releases/latest/
[2] http://docs.basex.org/wiki/Database_Module#db:output
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


[basex-talk] how to know creation options of a database

2013-01-02 Thread Fabrice Etanchaud
Dear all at BaseX,

How can I know the creation options of a given database ?

When I open a database created with a few non default options (MAXCATS set to 
1) for example,
GET MAXCATS seems to  always return the last value set with SET MAXCATS.


Regards,
Fabrice Etanchaud
Questel-Orbit
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] http server ... outsider localhost

2013-01-02 Thread Andy Bunce
Peter,
 Good to know it worked.
Christian,
 I think this change should be made to the github source

/Andy

On Tue, Jan 1, 2013 at 2:00 AM,  wrote:

> Andy
> changing the default to 0.0.0.0 worked.  Many thanks
>
> Peter
>
>  Original Message 
> From: bunce.a...@gmail.com
> To: p...@themail.co.uk
> Subject: Re: [basex-talk] http server ... outsider localhost
> Date: Mon, 31 Dec 2012 11:34:48 +
>
> >Hi Peter,
> >I wonder if this problem is related to a change I suggested to the
> >webapps/WEB_INF/jetty.xml file.
> >Do you still get the problem if you remove the line below and
> >restart?
> > >default=""/>
> >
> >Or if you change default="" to default="0.0.0.0" as suggested here
> >
> >http://osgeo-org.1560.n6.nabble.com/Cannot-connect-to-server-host-IP-
> >unless-it-s-localhost-td3861103.html
> >
> >Regards
> >
> >/Andy
> >
> >On Sun, Dec 30, 2012 at 5:30 PM,  wrote:
> >
> >> Hi Christian
> >>
> >> I just downloaded the BaseX 7.5 zip archive and ran the
> >> httpserver.bat file ... On the local machine I was able to access
> >> using the localhost or machine name as URLs, but access from
> >> elsewhere on the network got to the Jetty server (it logged "access
> >> denied") but apparently no further.
> >>
> >> Peter
> >>
> >>
> >>
> >>
> >>
> >> Hi Peter,
> >>
> >> the combination of BaseX and Jetty is successfully applied in many
> >> productive client/server environments. Can you provide us with some
> >> more details on how to reproduce the issue?
> >>
> >>
> >> Thanks,
> >> Christian
> >> ___
> >>
> >> > hello list --- Happy Christmas & New Year
> >> >
> >> > If I run the http server (Basex 7.5) then I can access through
> >> Jetty.
> >> > When I try to access the same across the network I get nothing
> >> > through and "Access denied" in the Basex logs. What's the
> >solution?
> >> >
> >> > Many thanks
> >> > Peter
> >> >
> >> > ___
> >> > 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 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] XQuery Update using IF Condition...

2013-01-02 Thread John Best
Dear Team,

I am getting error - If expression : no updating expression allowed -
while trying to update the "Data" DB.

I need to update the DB, if it is not already updated...


for $c in doc('2012')/Docs/Doc/No/@n
return
  if
(string-length(doc('Data')/Docs/Doc[No/@n=$c]/Title/Name/text()) eq 0) then
insert node $c into doc('Data')/Docs
  else
{''}


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