inspect:functions

Saturday, 26 April 2025 · 7 messages · last reply 1 May 2025
RS
Rob Stapper26 Apr 2025 13:32 #
Hi, I want to make use the 'inspect:functions'-function but whatever I do I always get this error: ' [inspect:parse] Stopped at C:/Users/Rob/Projecten/SemanticWorldModel/repo/SWM.main/content/IMPLEMENTATION-DOMAIN/reverseArrayIterator.xqm, 4/27: [XQST0049] Duplicate declaration of static variable .........' It looks like the function traverse all through the module structure following the module imports. And when it encouters a cyclic situation, which is not abnormal within a module structure, the function trigers this error. I think it should just stop on that branche because obviously the model has already been processed. Maybe even, the function should not iterate through the module structure at all, just returning the functions of the requested module. Maybe I'm just doing things wrong here. Can you please shed some light on how to prevent this error when using 'inspect:functions'? Some background for this madness: I want to annotate my FunctionDataStructure, dataStructures as functioncallparameterset, with the name of the module that contains the functions for this type/class of data (class and methods in OO). Thanks in advance for your responce. mvgr. Rob Stapper
CG
Christian Grün28 Apr 2025 19:02 #
Hi Rob, Feel free to provide us with a minimized code snippet to reproduce the problem. You could also try fn:load-xquery-module [1] that has recently been added to BaseX (thanks to Gunther Rademacher): https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-load-xquery-module Best, Christian
Quoted text · Rob Stapper · 34 lines
On Sat, Apr 26, 2025 at 1:33 PM Rob Stapper via BaseX-Talk < basex-talk at mailman.uni-konstanz.de> wrote: > Hi, > > I want to make use the 'inspect:functions'-function but whatever I do I > always get this error: > ' [inspect:parse] Stopped at > C:/Users/Rob/Projecten/SemanticWorldModel/repo/SWM.main/content/IMPLEMENTATION-DOMAIN/reverseArrayIterator.xqm, > 4/27: [XQST0049] Duplicate declaration of static variable .........' > > It looks like the function traverse all through the module structure > following the module imports. And when it encouters a cyclic situation, > which is not abnormal within a module structure, the function trigers this > error. I think it should just stop on that branche because obviously the > model has already been processed. > > Maybe even, the function should not iterate through the module structure > at all, just returning the functions of the requested module. > > Maybe I'm just doing things wrong here. Can you please shed some light on > how to prevent this error when using 'inspect:functions'? > > Some background for this madness: > I want to annotate my FunctionDataStructure, dataStructures as > functioncallparameterset, with the name of the module that contains the > functions for this type/class of data (class and methods in OO). > > Thanks in advance for your responce. > > mvgr. > > Rob Stapper > >
RS
Rob Stapper29 Apr 2025 12:45 #
Hi Christian, Hereby a compressed package with a simple and as far as I was able minimized code. Extract it in basex's repo directory and run: "add-app.xq". No need for installing the package in the repository. Hope this is sufficient. I'll have a look at the func-loadsquerymodule, looks promissing. Best, Rob
Quoted text · Christian Grün · 35 lines
> Op 28-04-2025 19:02 CEST schreef Christian Grün <christian.gruen at gmail.com>: > > > Hi Rob, > > Feel free to provide us with a minimized code snippet to reproduce the problem. You could also try fn:load-xquery-module [1] that has recently been added to BaseX (thanks to Gunther Rademacher): > > https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-load-xquery-module > > Best, > Christian > > On Sat, Apr 26, 2025 at 1:33 PM Rob Stapper via BaseX-Talk <basex-talk at mailman.uni-konstanz.de mailto:basex-talk at mailman.uni-konstanz.de> wrote: > > > Hi, > > > > I want to make use the 'inspect:functions'-function but whatever I do I always get this error: > > ' [inspect:parse] Stopped at C:/Users/Rob/Projecten/SemanticWorldModel/repo/SWM.main/content/IMPLEMENTATION-DOMAIN/reverseArrayIterator.xqm, 4/27: [XQST0049] Duplicate declaration of static variable .........' > > > > It looks like the function traverse all through the module structure following the module imports. And when it encouters a cyclic situation, which is not abnormal within a module structure, the function trigers this error. I think it should just stop on that branche because obviously the model has already been processed. > > > > Maybe even, the function should not iterate through the module structure at all, just returning the functions of the requested module. > > > > Maybe I'm just doing things wrong here. Can you please shed some light on how to prevent this error when using 'inspect:functions'? > > > > Some background for this madness: > > I want to annotate my FunctionDataStructure, dataStructures as functioncallparameterset, with the name of the module that contains the functions for this type/class of data (class and methods in OO). > > > > Thanks in advance for your responce. > > > > mvgr. > > > > Rob Stapper > > >
mvgr. Rob Stapper
CG
Christian Grün29 Apr 2025 12:51 #
Quoted text · Rob Stapper · 1 line
> Hereby a compressed package with a simple and as far as I was able
minimized code. Thanks. It seems to be identical to the bug in [1].
Quoted text · Rob Stapper · 1 line
> I'll have a look at the func-loadsquerymodule, looks promissing.
Quoted text · Rob Stapper · 71 lines
On Tue, Apr 29, 2025 at 12:45 PM Rob Stapper <r.stapper at lijbrandt.nl> wrote: > Hi Christian, > > Hereby a compressed package with a simple and as far as I was able > minimized code. Extract it in basex's repo directory and run: "add-app.xq". > No need for installing the package in the repository. Hope this is > sufficient. > > I'll have a look at the func-loadsquerymodule, looks promissing. > > Best, > Rob > > > Op 28-04-2025 19:02 CEST schreef Christian Grün <christian.gruen at gmail.com>: > > > > Hi Rob, > > Feel free to provide us with a minimized code snippet to reproduce the > problem. You could also try fn:load-xquery-module [1] that has recently > been added to BaseX (thanks to Gunther Rademacher): > > > https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-load-xquery-module > > Best, > Christian > > On Sat, Apr 26, 2025 at 1:33 PM Rob Stapper via BaseX-Talk < > basex-talk at mailman.uni-konstanz.de> wrote: > > Hi, > > I want to make use the 'inspect:functions'-function but whatever I do I > always get this error: > ' [inspect:parse] Stopped at > C:/Users/Rob/Projecten/SemanticWorldModel/repo/SWM.main/content/IMPLEMENTATION-DOMAIN/reverseArrayIterator.xqm, > 4/27: [XQST0049] Duplicate declaration of static variable .........' > > It looks like the function traverse all through the module structure > following the module imports. And when it encouters a cyclic situation, > which is not abnormal within a module structure, the function trigers this > error. I think it should just stop on that branche because obviously the > model has already been processed. > > Maybe even, the function should not iterate through the module structure > at all, just returning the functions of the requested module. > > Maybe I'm just doing things wrong here. Can you please shed some light on > how to prevent this error when using 'inspect:functions'? > > Some background for this madness: > I want to annotate my FunctionDataStructure, dataStructures as > functioncallparameterset, with the name of the module that contains the > functions for this type/class of data (class and methods in OO). > > Thanks in advance for your responce. > > mvgr. > > Rob Stapper > > > > mvgr. > > Rob Stapper > >
RS
Rob Stapper29 Apr 2025 15:59 #
succes, 'load-xquery-module' does the trick, allthough, when referencing to itself throught the: 'location-hints' option one gets a tail-recursion error. Obvious , but it would be more elegant if the function recognized the situation and just stops. I attached a working package using 'load-xquery-module'. You known what would be realy awsome:-)) If it was possible to give an annotation the value of the static-base-uri of its module. I know annotations can only be given a static value but how dynamic is the static-base-uri actually, the name suggest otherwise. Alternative would be if one could trace back the module's uri from the module's target namespace. The result of repo:list() could be extended with this, it is available somewhere, I can see it i the GUI's package option. Is there something you can do here? I know you're busy, though. Best, Rob.
Quoted text · Christian Grün · 68 lines
> Op 29-04-2025 12:51 CEST schreef Christian Grün <christian.gruen at gmail.com>: > > .. > > Hereby a compressed package with a simple and as far as I was able minimized code. > > Thanks. It seems to be identical to the bug in [1]. > > > I'll have a look at the func-loadsquerymodule, looks promissing. > > Looking forward. > > [1] https://github.com/BaseXdb/basex/issues/1194 > > > On Tue, Apr 29, 2025 at 12:45 PM Rob Stapper <r.stapper at lijbrandt.nl mailto:r.stapper at lijbrandt.nl> wrote: > > > Hi Christian, > > > > Hereby a compressed package with a simple and as far as I was able minimized code. Extract it in basex's repo directory and run: "add-app.xq". No need for installing the package in the repository. Hope this is sufficient. > > > > I'll have a look at the func-loadsquerymodule, looks promissing. > > > > Best, > > Rob > > > > > > > Op 28-04-2025 19:02 CEST schreef Christian Grün <christian.gruen at gmail.com mailto:christian.gruen at gmail.com>: > > > > > > > > > Hi Rob, > > > > > > Feel free to provide us with a minimized code snippet to reproduce the problem. You could also try fn:load-xquery-module [1] that has recently been added to BaseX (thanks to Gunther Rademacher): > > > > > > https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-load-xquery-module > > > > > > Best, > > > Christian > > > > > > On Sat, Apr 26, 2025 at 1:33 PM Rob Stapper via BaseX-Talk <basex-talk at mailman.uni-konstanz.de mailto:basex-talk at mailman.uni-konstanz.de> wrote: > > > > > > > Hi, > > > > > > > > I want to make use the 'inspect:functions'-function but whatever I do I always get this error: > > > > ' [inspect:parse] Stopped at C:/Users/Rob/Projecten/SemanticWorldModel/repo/SWM.main/content/IMPLEMENTATION-DOMAIN/reverseArrayIterator.xqm, 4/27: [XQST0049] Duplicate declaration of static variable .........' > > > > > > > > It looks like the function traverse all through the module structure following the module imports. And when it encouters a cyclic situation, which is not abnormal within a module structure, the function trigers this error. I think it should just stop on that branche because obviously the model has already been processed. > > > > > > > > Maybe even, the function should not iterate through the module structure at all, just returning the functions of the requested module. > > > > > > > > Maybe I'm just doing things wrong here. Can you please shed some light on how to prevent this error when using 'inspect:functions'? > > > > > > > > Some background for this madness: > > > > I want to annotate my FunctionDataStructure, dataStructures as functioncallparameterset, with the name of the module that contains the functions for this type/class of data (class and methods in OO). > > > > > > > > Thanks in advance for your responce. > > > > > > > > mvgr. > > > > > > > > Rob Stapper > > > > > > > > > > > > > mvgr. > > > > Rob Stapper > > >
mvgr. Rob Stapper
CG
Christian Grün29 Apr 2025 19:11 #
You may want to have a look at the new 4.0 record [1] and method features [2]. Best, Christian [1] https://docs.basex.org/12/XQuery_4.0#record_declarations [2] https://docs.basex.org/12/XQuery_4.0#methods
Quoted text · Rob Stapper · 117 lines
On Tue, Apr 29, 2025 at 3:59 PM Rob Stapper <r.stapper at lijbrandt.nl> wrote: > succes, 'load-xquery-module' does the trick, allthough, when referencing > to itself throught the: 'location-hints' option one gets a tail-recursion > error. Obvious > , but it would be more elegant if the function recognized the situation > and just stops. > > I attached a working package using 'load-xquery-module'. > > You known what would be realy awsome:-)) If it was possible to give an > annotation the value of the *static-base-uri* of its module. I know > annotations can only be given a static value but how dynamic is the > static-base-uri actually, the name suggest otherwise. Alternative would be > if one could trace back the module's uri from the module's target > namespace. The result of repo:list() could be extended with this, it is > available somewhere, I can see it i the GUI's package option. > > Is there something you can do here? I know you're busy, though. > > Best, > Rob. > > Op 29-04-2025 12:51 CEST schreef Christian Grün <christian.gruen at gmail.com>: > > > .. > > Hereby a compressed package with a simple and as far as I was able > minimized code. > > Thanks. It seems to be identical to the bug in [1]. > > > I'll have a look at the func-loadsquerymodule, looks promissing. > > Looking forward. > > [1] https://github.com/BaseXdb/basex/issues/1194 > > > On Tue, Apr 29, 2025 at 12:45 PM Rob Stapper <r.stapper at lijbrandt.nl> > wrote: > > Hi Christian, > > Hereby a compressed package with a simple and as far as I was able > minimized code. Extract it in basex's repo directory and run: "add-app.xq". > No need for installing the package in the repository. Hope this is > sufficient. > > I'll have a look at the func-loadsquerymodule, looks promissing. > > Best, > Rob > > > Op 28-04-2025 19:02 CEST schreef Christian Grün <christian.gruen at gmail.com>: > > > > Hi Rob, > > Feel free to provide us with a minimized code snippet to reproduce the > problem. You could also try fn:load-xquery-module [1] that has recently > been added to BaseX (thanks to Gunther Rademacher): > > > https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-load-xquery-module > > Best, > Christian > > On Sat, Apr 26, 2025 at 1:33 PM Rob Stapper via BaseX-Talk < > basex-talk at mailman.uni-konstanz.de> wrote: > > Hi, > > I want to make use the 'inspect:functions'-function but whatever I do I > always get this error: > ' [inspect:parse] Stopped at > C:/Users/Rob/Projecten/SemanticWorldModel/repo/SWM.main/content/IMPLEMENTATION-DOMAIN/reverseArrayIterator.xqm, > 4/27: [XQST0049] Duplicate declaration of static variable .........' > > It looks like the function traverse all through the module structure > following the module imports. And when it encouters a cyclic situation, > which is not abnormal within a module structure, the function trigers this > error. I think it should just stop on that branche because obviously the > model has already been processed. > > Maybe even, the function should not iterate through the module structure > at all, just returning the functions of the requested module. > > Maybe I'm just doing things wrong here. Can you please shed some light on > how to prevent this error when using 'inspect:functions'? > > Some background for this madness: > I want to annotate my FunctionDataStructure, dataStructures as > functioncallparameterset, with the name of the module that contains the > functions for this type/class of data (class and methods in OO). > > Thanks in advance for your responce. > > mvgr. > > Rob Stapper > > > > mvgr. > > Rob Stapper > > > > mvgr. > > Rob Stapper > >
RS
Rob Stapper1 May 2025 09:43 #
Christian, thank you for the tips. The advantage of a functional data structure as an implementation for records is that it doesn't have fixed component names, so lower maintenance if one wants to rename a component. An other advantage is that it doesn't need an extra data structure for storing the data, in this case a map-variable. Hence my preference for functional data structures. To bad that I'll have to assign the module's static-base-uri to its function-annotations as a literal. Fortunately I only have to do this ones for each (objectType)module so it is managable. Best, Rob
Quoted text · Christian Grün · 98 lines
> Op 29-04-2025 19:11 CEST schreef Christian Grün <christian.gruen at gmail.com>: > > > You may want to have a look at the new 4.0 record [1] and method features [2]. > Best, Christian > > [1] https://docs.basex.org/12/XQuery_4.0#record_declarations > [2] https://docs.basex.org/12/XQuery_4.0#methods > > On Tue, Apr 29, 2025 at 3:59 PM Rob Stapper <r.stapper at lijbrandt.nl mailto:r.stapper at lijbrandt.nl> wrote: > > > succes, 'load-xquery-module' does the trick, allthough, when referencing to itself throught the: 'location-hints' option one gets a tail-recursion error. Obvious > > , but it would be more elegant if the function recognized the situation and just stops. > > > > I attached a working package using 'load-xquery-module'. > > > > You known what would be realy awsome:-)) If it was possible to give an annotation the value of the static-base-uri of its module. I know annotations can only be given a static value but how dynamic is the static-base-uri actually, the name suggest otherwise. Alternative would be if one could trace back the module's uri from the module's target namespace. The result of repo:list() could be extended with this, it is available somewhere, I can see it i the GUI's package option. > > > > Is there something you can do here? I know you're busy, though. > > > > Best, > > Rob. > > > > > Op 29-04-2025 12:51 CEST schreef Christian Grün <christian.gruen at gmail.com mailto:christian.gruen at gmail.com>: > > > > > > .. > > > > Hereby a compressed package with a simple and as far as I was able minimized code. > > > > > > Thanks. It seems to be identical to the bug in [1]. > > > > > > > I'll have a look at the func-loadsquerymodule, looks promissing. > > > > > > Looking forward. > > > > > > [1] https://github.com/BaseXdb/basex/issues/1194 > > > > > > > > > On Tue, Apr 29, 2025 at 12:45 PM Rob Stapper <r.stapper at lijbrandt.nl mailto:r.stapper at lijbrandt.nl> wrote: > > > > > > > Hi Christian, > > > > > > > > Hereby a compressed package with a simple and as far as I was able minimized code. Extract it in basex's repo directory and run: "add-app.xq". No need for installing the package in the repository. Hope this is sufficient. > > > > > > > > I'll have a look at the func-loadsquerymodule, looks promissing. > > > > > > > > Best, > > > > Rob > > > > > > > > > > > > > Op 28-04-2025 19:02 CEST schreef Christian Grün <christian.gruen at gmail.com mailto:christian.gruen at gmail.com>: > > > > > > > > > > > > > > > Hi Rob, > > > > > > > > > > Feel free to provide us with a minimized code snippet to reproduce the problem. You could also try fn:load-xquery-module [1] that has recently been added to BaseX (thanks to Gunther Rademacher): > > > > > > > > > > https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-load-xquery-module > > > > > > > > > > Best, > > > > > Christian > > > > > > > > > > On Sat, Apr 26, 2025 at 1:33 PM Rob Stapper via BaseX-Talk <basex-talk at mailman.uni-konstanz.de mailto:basex-talk at mailman.uni-konstanz.de> wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > I want to make use the 'inspect:functions'-function but whatever I do I always get this error: > > > > > > ' [inspect:parse] Stopped at C:/Users/Rob/Projecten/SemanticWorldModel/repo/SWM.main/content/IMPLEMENTATION-DOMAIN/reverseArrayIterator.xqm, 4/27: [XQST0049] Duplicate declaration of static variable .........' > > > > > > > > > > > > It looks like the function traverse all through the module structure following the module imports. And when it encouters a cyclic situation, which is not abnormal within a module structure, the function trigers this error. I think it should just stop on that branche because obviously the model has already been processed. > > > > > > > > > > > > Maybe even, the function should not iterate through the module structure at all, just returning the functions of the requested module. > > > > > > > > > > > > Maybe I'm just doing things wrong here. Can you please shed some light on how to prevent this error when using 'inspect:functions'? > > > > > > > > > > > > Some background for this madness: > > > > > > I want to annotate my FunctionDataStructure, dataStructures as functioncallparameterset, with the name of the module that contains the functions for this type/class of data (class and methods in OO). > > > > > > > > > > > > Thanks in advance for your responce. > > > > > > > > > > > > mvgr. > > > > > > > > > > > > Rob Stapper > > > > > > > > > > > > > > > > > > > > > > > mvgr. > > > > > > > > Rob Stapper > > > > > > > > > > > > > mvgr. > > > > Rob Stapper > > >
mvgr. Rob Stapper

⚡Generated with XQuery