RESTXQ: function loading
Thursday, 9 July 2015 · 5 messages · last reply 15 Jul 2015
JC
Jérôme Chauveau9 Jul 2015 15:46 #
Hi,
i'd like to execute a function (which I wrote in an .xqm module) with an
fn:function-lookup call.
This function has no %rest:path annotation and seems to be unavailable from the current context function list (I inpected it with an inspect:context//function call).
Is there a way to "force" its loading?
I am currently working with the last BaseX8.2.2 war version.
Thanks.
Regards,
Jérôme--
Jérôme Chauveau - CERTIC-DSI - Campus I
Université de Caen Basse-Normandie
DK
Dirk Kirsten9 Jul 2015 17:12 #
Bonjour Jérôme,
I am having trouble to replicate the issue. I just tried the
inspect:functions() call from an xqm module and I am having no trouble seeing the functions from another XQuery module. Did you import the module? Could you maybe send a SSCCE (http://sscce.org/), so that we can easily see the problem ourself?
Cheers
DirkQuoted text · Jérôme Chauveau · 20 lines
On 07/09/2015 03:46 PM, Jérôme Chauveau wrote: > Hi, > > i'd like to execute a function (which I wrote in an .xqm module) with > an fn:function-lookup call. > > This function has no %rest:path annotation and seems to be unavailable > from the current context function list (I inpected it with an > inspect:context//function call). > > Is there a way to "force" its loading? > > I am currently working with the last BaseX8.2.2 war version. > > Thanks. > > Regards, > > Jérôme >
--
Dirk Kirsten, BaseX GmbH, http://basexgmbh.de
|-- 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
JC
Jérôme Chauveau9 Jul 2015 18:07 #
Hi Dirk,
thank you for your answer.
My previous message was not clear enough... sorry for that. I did not import the module
because the function-lookup call is executed from my main module which is not supposed to be modified.
I've just found this message which perfectly matches my scenario: https://mailman.uni-konstanz.de/pipermail/basex-talk/2013-June/005257.html
I am now running an xquery:invoke as a workaround...
Ideally, my main module should be able to list a "plugin" folder then load all module of that one.
Dynamic module loading as I need seems to be not possible - am i right?
Thank you.
Jérôme
Quoted text · Dirk Kirsten · 32 lines
Le 09/07/2015 17:12, Dirk Kirsten a écrit : > Bonjour Jérôme, > > I am having trouble to replicate the issue. I just tried the > inspect:functions() call from an xqm module and I am having no trouble > seeing the functions from another XQuery module. Did you import the module? > Could you maybe send a SSCCE (http://sscce.org/), so that we can easily > see the problem ourself? > > Cheers > Dirk > > On 07/09/2015 03:46 PM, Jérôme Chauveau wrote: >> Hi, >> >> i'd like to execute a function (which I wrote in an .xqm module) with >> an fn:function-lookup call. >> >> This function has no %rest:path annotation and seems to be unavailable >> from the current context function list (I inpected it with an >> inspect:context//function call). >> >> Is there a way to "force" its loading? >> >> I am currently working with the last BaseX8.2.2 war version. >> >> Thanks. >> >> Regards, >> >> Jérôme >>
--
Jérôme Chauveau - CERTIC-DSI - Campus I
Université de Caen Basse-Normandie
CG
Christian Grün10 Jul 2015 15:13 #
Hi Jérôme,
With the
fn:function-lookup call, as you already guessed, you can only invoke functions that are available in the static context of a query.
However, XQuery 3.1 will provide a new function load-xquery-module. We haven't implemented it yet, as it's still being specified, but feel free to look at the function, and give us some feedback if you think this function is what you would need!
All the best,
Christian
[1] http://www.w3.org/TR/xpath-functions-31/#func-load-xquery-moduleQuoted text · Jérôme Chauveau · 66 lines
On Thu, Jul 9, 2015 at 6:07 PM, Jérôme Chauveau <jerome.chauveau at unicaen.fr> wrote: > Hi Dirk, > > thank you for your answer. > My previous message was not clear enough... sorry for that. I did not import > the module > because the function-lookup call is executed from my main module which > is not supposed to be modified. > > I've just found this message which perfectly matches my scenario: > https://mailman.uni-konstanz.de/pipermail/basex-talk/2013-June/005257.html > > I am now running an xquery:invoke as a workaround... > > Ideally, my main module should be able to list a "plugin" folder then load > all module of that one. > > Dynamic module loading as I need seems to be not possible - am i right? > > Thank you. > > Jérôme > > > Le 09/07/2015 17:12, Dirk Kirsten a écrit : >> >> Bonjour Jérôme, >> >> I am having trouble to replicate the issue. I just tried the >> inspect:functions() call from an xqm module and I am having no trouble >> seeing the functions from another XQuery module. Did you import the >> module? >> Could you maybe send a SSCCE (http://sscce.org/), so that we can easily >> see the problem ourself? >> >> Cheers >> Dirk >> >> On 07/09/2015 03:46 PM, Jérôme Chauveau wrote: >>> >>> Hi, >>> >>> i'd like to execute a function (which I wrote in an .xqm module) with >>> an fn:function-lookup call. >>> >>> This function has no %rest:path annotation and seems to be unavailable >>> from the current context function list (I inpected it with an >>> inspect:context//function call). >>> >>> Is there a way to "force" its loading? >>> >>> I am currently working with the last BaseX8.2.2 war version. >>> >>> Thanks. >>> >>> Regards, >>> >>> Jérôme >>> > > > -- > Jérôme Chauveau - CERTIC-DSI - Campus I > Université de Caen Basse-Normandie >
JC
Jérôme Chauveau15 Jul 2015 11:25 #
Hi Christian,
Thank you for your answer.
You are right! The load-xquery-module function seems to be exactly what I need.
I hope it will be implemented one day.
Regards,
Jérôme
Quoted text · Christian Grün · 81 lines
Le 10/07/2015 15:13, Christian Grün a écrit : > Hi Jérôme, > > With the fn:function-lookup call, as you already guessed, you can only > invoke functions that are available in the static context of a query. > > However, XQuery 3.1 will provide a new function load-xquery-module. We > haven't implemented it yet, as it's still being specified, but feel > free to look at the function, and give us some feedback if you think > this function is what you would need! > > All the best, > Christian > > [1] http://www.w3.org/TR/xpath-functions-31/#func-load-xquery-module > > > > On Thu, Jul 9, 2015 at 6:07 PM, Jérôme Chauveau > <jerome.chauveau at unicaen.fr> wrote: >> Hi Dirk, >> >> thank you for your answer. >> My previous message was not clear enough... sorry for that. I did not import >> the module >> because the function-lookup call is executed from my main module which >> is not supposed to be modified. >> >> I've just found this message which perfectly matches my scenario: >> https://mailman.uni-konstanz.de/pipermail/basex-talk/2013-June/005257.html >> >> I am now running an xquery:invoke as a workaround... >> >> Ideally, my main module should be able to list a "plugin" folder then load >> all module of that one. >> >> Dynamic module loading as I need seems to be not possible - am i right? >> >> Thank you. >> >> Jérôme >> >> >> Le 09/07/2015 17:12, Dirk Kirsten a écrit : >>> Bonjour Jérôme, >>> >>> I am having trouble to replicate the issue. I just tried the >>> inspect:functions() call from an xqm module and I am having no trouble >>> seeing the functions from another XQuery module. Did you import the >>> module? >>> Could you maybe send a SSCCE (http://sscce.org/), so that we can easily >>> see the problem ourself? >>> >>> Cheers >>> Dirk >>> >>> On 07/09/2015 03:46 PM, Jérôme Chauveau wrote: >>>> Hi, >>>> >>>> i'd like to execute a function (which I wrote in an .xqm module) with >>>> an fn:function-lookup call. >>>> >>>> This function has no %rest:path annotation and seems to be unavailable >>>> from the current context function list (I inpected it with an >>>> inspect:context//function call). >>>> >>>> Is there a way to "force" its loading? >>>> >>>> I am currently working with the last BaseX8.2.2 war version. >>>> >>>> Thanks. >>>> >>>> Regards, >>>> >>>> Jérôme >>>> >> >> -- >> Jérôme Chauveau - CERTIC-DSI - Campus I >> Université de Caen Basse-Normandie >>
--
Jérôme Chauveau - CERTIC-DSI - Campus I
Université de Caen Basse-Normandie
Written for BaseX 8.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery