Re: [basex-talk] Database specific xquery modules

2020-02-20 Thread Markus Wittenberg
If you want to use RESTXQ you would have to put the modules, or least the functions defining the endpoints, in the webapp directory and not in the repo directory. And far as I know, BaseX doesn't support installation for modules in webapp as for in repo. So you have to explicitly change/add fil

Re: [basex-talk] Database specific xquery modules

2020-02-20 Thread DYER Chris
Hi Markus, Not quite what I am aiming for. We do want a single BaseX Instance to provide access to multiple databases. Further to this though, a set of client applications will only connect to one database. We have multiple sets of client applications, with each set each connecting to one datab

Re: [basex-talk] Database specific xquery modules

2020-02-20 Thread Markus Wittenberg
A RESTXQ definition could look something like this: |declare| |    %rest:path||(||"/a/{$client}/{$path}"||)| |function| |yourmodule:test(||$client as xs:string||, ||$||path ||as xs:string) {| |let $db := switch ($client)| |    case "clientA" return db:open("dbA")| ||| | |    case "clientA"

Re: [basex-talk] Database specific xquery modules

2020-02-20 Thread DYER Chris
Hi Markus, Our intent is to use REST and RESTXQ interfaces to interact with data on a single database using some server side XQueries. However, we may have 2 (or more) databases provided by some server, and associated xqueries are specific to the contents of each database (as the contents of ea

Re: [basex-talk] Database specific xquery modules

2020-02-20 Thread Markus Wittenberg
 Hi Chris, as you might already know, BaseX has built-in REST support [1] which you can use to query and update data via HTTP. You can also use the RESTXQ [2] functionality to define arbitrary server side XQueries which can also be requested by HTTP and are also suitable for web applications.

[basex-talk] Database specific xquery modules

2020-02-20 Thread DYER Chris
I am looking for some ideas on some architecture surrounding xquery modules. Our situation is that we have multiple client applications in various languages that will connect to a database. We will have some reasonably complex xqueries to extract data in certain structures that will be used by e

Re: [basex-talk] update:apply, Context is undeclared. (Newbie)

2020-02-20 Thread Christian Grün
Hi Ben, > 1: How can I achieve the same task, using functx:remove-elements and > update:for-each? It would look like this: import module namespace functx = 'http://www.functx.com'; let $names := ('db1', 'db2') return update:for-each( collection("TextMining/nl-verbs.csv")/csv/record,

Re: [basex-talk] how to store a result in a database?

2020-02-20 Thread Christian Grün
Hi Thufir, > I see what you mean by passing the query result as the second argument > to the db:add function, but am getting: > [XPST0003] Expecting function argument. Please take a few times to read our docs and try out the examples; I’m sure you’ll find out soon what’s the correct syntax. Best

Re: [basex-talk] how to store a result in a database?

2020-02-20 Thread thufir
I see what you mean by passing the query result as the second argument to the db:add function, but am getting: [XPST0003] Expecting function argument. A syntax problem? xquery version "3.0"; db:add("foo.clean.xml", { for $x in db:open("foo.txt")/text/line return $x } On 2020-02-19

[basex-talk] empty tags when grouping with tumbling window?

2020-02-20 Thread thufir
I found (another) wrinkle to parsing this data because blank lines seem to cause a problem with the grouping. The grouping should "use a tumbling window which starts with any line not containing any ASCII digit (the name of the person) followed by any line containing at least one ASCII digit (