Circular module dependency
Tuesday, 18 June 2013 · 5 messages · last reply 22 Jul 2013
JM
Jean-philippe Magué18 Jun 2013 10:19 #
Hi,
I'm having problem with modules importing each other. I have the two following restxq modules :
moduleA.xqm
------------------
module namespace moduleA = 'http:/www.example.com/moduleA';
import module namespace moduleB = 'http:/www.example.com/moduleB' at
'moduleB.xqm';declare function moduleA:f() {
""
};
------------------
moduleB.xqm
------------------
module namespace moduleB = 'http:/www.example.com/moduleB';
import module namespace moduleA = 'http:/www.example.com/moduleA' at
'moduleA.xqm';
------------------They fail to compile with the following error:
Stopped at line 7, column 29 in
/Users/jmague/work/basex/webapp/restxq/moduleA.xqm:
[XQST0034] Duplicate declaration of function moduleA:f(...).
Are cross imports just forbidden ? Yet, the XQuery specification state that (section 4.12.4 Cycles) : "Implementations must resolve cycles in the import graph, either at the level of module URIs or at the level of location URIs, and ensure that each module is imported only once."
Best,
Jean-Philippe
--
Jean-Philippe Magué
Maître de Conférences en Humanités Numériques
Responsable de l'Atelier des Humanités Numériques : ahn.ens-lyon.fr Ecole Normale Supérieure de Lyon
+33 (0)4 26 23 38 08
--
"Using computers will therefore lead us to a more profound and systematic knowledge of human expression; in principle, it can help us to be more humanistic than before."
Busa, 1980.
CG
Christian Grün18 Jun 2013 14:32 #
Hi Jean-Philippe,
thanks for your mail. Your code seems to work properly when using plain XQuery, so I assume the problem is related to RESTXQ. We'll have a closer look at that.
Best,
Christian
___________________________
2013/6/18 Jean-philippe Magué <jean-philippe.mague at ens-lyon.fr>:
Quoted text · Jean-philippe Magué · 63 lines
> Hi, > > I'm having problem with modules importing each other. I have the two > following restxq modules : > > moduleA.xqm > ------------------ > module namespace moduleA = 'http:/www.example.com/moduleA'; > > import module namespace moduleB = 'http:/www.example.com/moduleB' at > 'moduleB.xqm'; > > declare function moduleA:f() { > "" > }; > ------------------ > > > > moduleB.xqm > ------------------ > module namespace moduleB = 'http:/www.example.com/moduleB'; > > import module namespace moduleA = 'http:/www.example.com/moduleA' at > 'moduleA.xqm'; > ------------------ > > They fail to compile with the following error: > > Stopped at line 7, column 29 in > /Users/jmague/work/basex/webapp/restxq/moduleA.xqm: > [XQST0034] Duplicate declaration of function moduleA:f(...). > > Are cross imports just forbidden ? Yet, the XQuery specification state that > (section 4.12.4 Cycles) : "Implementations must resolve cycles in the import > graph, either at the level of module URIs or at the level of location URIs, > and ensure that each module is imported only once." > > > Best, > > Jean-Philippe > > > -- > Jean-Philippe Magué > Maître de Conférences en Humanités Numériques > Responsable de l'Atelier des Humanités Numériques : ahn.ens-lyon.fr > Ecole Normale Supérieure de Lyon > +33 (0)4 26 23 38 08 > > -- > > "Using computers will therefore lead us to a more profound and systematic > knowledge of human expression; in principle, it can help us to be more > humanistic than before." > Busa, 1980. > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
CG
Christian Grün5 Jul 2013 20:59 #
Hi Jean-Philippe,
I’m glad to tell the problem with circular dependencies is now fixed. Feel free to check out the latest stable snapshot [1].
All the best,
Christian
[1] http://files.basex.org/releases/latest/
___________________________
2013/6/18 Christian Grün <christian.gruen at gmail.com>:
Quoted text · Christian Grün · 74 lines
> Hi Jean-Philippe, > > thanks for your mail. Your code seems to work properly when using > plain XQuery, so I assume the problem is related to RESTXQ. We'll have > a closer look at that. > > Best, > Christian > ___________________________ > > 2013/6/18 Jean-philippe Magué <jean-philippe.mague at ens-lyon.fr>: >> Hi, >> >> I'm having problem with modules importing each other. I have the two >> following restxq modules : >> >> moduleA.xqm >> ------------------ >> module namespace moduleA = 'http:/www.example.com/moduleA'; >> >> import module namespace moduleB = 'http:/www.example.com/moduleB' at >> 'moduleB.xqm'; >> >> declare function moduleA:f() { >> "" >> }; >> ------------------ >> >> >> >> moduleB.xqm >> ------------------ >> module namespace moduleB = 'http:/www.example.com/moduleB'; >> >> import module namespace moduleA = 'http:/www.example.com/moduleA' at >> 'moduleA.xqm'; >> ------------------ >> >> They fail to compile with the following error: >> >> Stopped at line 7, column 29 in >> /Users/jmague/work/basex/webapp/restxq/moduleA.xqm: >> [XQST0034] Duplicate declaration of function moduleA:f(...). >> >> Are cross imports just forbidden ? Yet, the XQuery specification state that >> (section 4.12.4 Cycles) : "Implementations must resolve cycles in the import >> graph, either at the level of module URIs or at the level of location URIs, >> and ensure that each module is imported only once." >> >> >> Best, >> >> Jean-Philippe >> >> >> -- >> Jean-Philippe Magué >> Maître de Conférences en Humanités Numériques >> Responsable de l'Atelier des Humanités Numériques : ahn.ens-lyon.fr >> Ecole Normale Supérieure de Lyon >> +33 (0)4 26 23 38 08 >> >> -- >> >> "Using computers will therefore lead us to a more profound and systematic >> knowledge of human expression; in principle, it can help us to be more >> humanistic than before." >> Busa, 1980. >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>
JM
Jean-philippe Magué22 Jul 2013 14:39 #
Hi Christian !
Sorry for the late answer. A new baby at home, then short holidays, I've out of my mail for a while...
Thanks for solving the problem. I'm going to check this out right now !
Best,
Jean-Philippe
On Fri, Jul 5, 2013 at 8:59 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 91 lines
> Hi Jean-Philippe, > > I’m glad to tell the problem with circular dependencies is now fixed. > Feel free to check out the latest stable snapshot [1]. > > All the best, > Christian > > [1] http://files.basex.org/releases/latest/ > ___________________________ > > 2013/6/18 Christian Grün <christian.gruen at gmail.com>: > > Hi Jean-Philippe, > > > > thanks for your mail. Your code seems to work properly when using > > plain XQuery, so I assume the problem is related to RESTXQ. We'll have > > a closer look at that. > > > > Best, > > Christian > > ___________________________ > > > > 2013/6/18 Jean-philippe Magué <jean-philippe.mague at ens-lyon.fr>: > >> Hi, > >> > >> I'm having problem with modules importing each other. I have the two > >> following restxq modules : > >> > >> moduleA.xqm > >> ------------------ > >> module namespace moduleA = 'http:/www.example.com/moduleA'; > >> > >> import module namespace moduleB = 'http:/www.example.com/moduleB' at > >> 'moduleB.xqm'; > >> > >> declare function moduleA:f() { > >> "" > >> }; > >> ------------------ > >> > >> > >> > >> moduleB.xqm > >> ------------------ > >> module namespace moduleB = 'http:/www.example.com/moduleB'; > >> > >> import module namespace moduleA = 'http:/www.example.com/moduleA' at > >> 'moduleA.xqm'; > >> ------------------ > >> > >> They fail to compile with the following error: > >> > >> Stopped at line 7, column 29 in > >> /Users/jmague/work/basex/webapp/restxq/moduleA.xqm: > >> [XQST0034] Duplicate declaration of function moduleA:f(...). > >> > >> Are cross imports just forbidden ? Yet, the XQuery specification state > that > >> (section 4.12.4 Cycles) : "Implementations must resolve cycles in the > import > >> graph, either at the level of module URIs or at the level of location > URIs, > >> and ensure that each module is imported only once." > >> > >> > >> Best, > >> > >> Jean-Philippe > >> > >> > >> -- > >> Jean-Philippe Magué > >> Maître de Conférences en Humanités Numériques > >> Responsable de l'Atelier des Humanités Numériques : ahn.ens-lyon.fr > >> Ecole Normale Supérieure de Lyon > >> +33 (0)4 26 23 38 08 > >> > >> -- > >> > >> "Using computers will therefore lead us to a more profound and > systematic > >> knowledge of human expression; in principle, it can help us to be more > >> humanistic than before." > >> Busa, 1980. > >> > >> _______________________________________________ > >> BaseX-Talk mailing list > >> BaseX-Talk at mailman.uni-konstanz.de > >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >> >
--
Jean-Philippe Magué
Maître de Conférences en Humanités Numériques
Responsable de l'Atelier des Humanités Numériques : ahn.ens-lyon.fr Ecole Normale Supérieure de Lyon
+33 (0)4 26 23 38 08
--
"Using computers will therefore lead us to a more profound and systematic knowledge of human expression; in principle, it can help us to be more humanistic than before."
Busa, 1980.
AH
Alexander Holupirek22 Jul 2013 14:41 #
Quoted text · Jean-philippe Magué · 4 lines
On 22.07.2013, at 14:39, Jean-philippe Magué <jean-philippe.mague at ens-lyon.fr> wrote: > Hi Christian ! > > Sorry for the late answer. A new baby at home …
Uh, yeah, congrats!
Alex ;-)
Quoted text · Christian Grün · 105 lines
> On Fri, Jul 5, 2013 at 8:59 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Jean-Philippe, > > I’m glad to tell the problem with circular dependencies is now fixed. > Feel free to check out the latest stable snapshot [1]. > > All the best, > Christian > > [1] http://files.basex.org/releases/latest/ > ___________________________ > > 2013/6/18 Christian Grün <christian.gruen at gmail.com>: > > Hi Jean-Philippe, > > > > thanks for your mail. Your code seems to work properly when using > > plain XQuery, so I assume the problem is related to RESTXQ. We'll have > > a closer look at that. > > > > Best, > > Christian > > ___________________________ > > > > 2013/6/18 Jean-philippe Magué <jean-philippe.mague at ens-lyon.fr>: > >> Hi, > >> > >> I'm having problem with modules importing each other. I have the two > >> following restxq modules : > >> > >> moduleA.xqm > >> ------------------ > >> module namespace moduleA = 'http:/www.example.com/moduleA'; > >> > >> import module namespace moduleB = 'http:/www.example.com/moduleB' at > >> 'moduleB.xqm'; > >> > >> declare function moduleA:f() { > >> "" > >> }; > >> ------------------ > >> > >> > >> > >> moduleB.xqm > >> ------------------ > >> module namespace moduleB = 'http:/www.example.com/moduleB'; > >> > >> import module namespace moduleA = 'http:/www.example.com/moduleA' at > >> 'moduleA.xqm'; > >> ------------------ > >> > >> They fail to compile with the following error: > >> > >> Stopped at line 7, column 29 in > >> /Users/jmague/work/basex/webapp/restxq/moduleA.xqm: > >> [XQST0034] Duplicate declaration of function moduleA:f(...). > >> > >> Are cross imports just forbidden ? Yet, the XQuery specification state that > >> (section 4.12.4 Cycles) : "Implementations must resolve cycles in the import > >> graph, either at the level of module URIs or at the level of location URIs, > >> and ensure that each module is imported only once." > >> > >> > >> Best, > >> > >> Jean-Philippe > >> > >> > >> -- > >> Jean-Philippe Magué > >> Maître de Conférences en Humanités Numériques > >> Responsable de l'Atelier des Humanités Numériques : ahn.ens-lyon.fr > >> Ecole Normale Supérieure de Lyon > >> +33 (0)4 26 23 38 08 > >> > >> -- > >> > >> "Using computers will therefore lead us to a more profound and systematic > >> knowledge of human expression; in principle, it can help us to be more > >> humanistic than before." > >> Busa, 1980. > >> > >> _______________________________________________ > >> BaseX-Talk mailing list > >> BaseX-Talk at mailman.uni-konstanz.de > >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >> > > > > -- > Jean-Philippe Magué > Maître de Conférences en Humanités Numériques > Responsable de l'Atelier des Humanités Numériques : ahn.ens-lyon.fr > Ecole Normale Supérieure de Lyon > +33 (0)4 26 23 38 08 > > -- > > "Using computers will therefore lead us to a more profound and systematic knowledge of human expression; in principle, it can help us to be more humanistic than before." > Busa, 1980. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Dr. Alexander Holupirek
|-- Room E 221, 0049 7531 88 2188 (phone) 3577 (fax)
|-- Database & Information Systems Group, U Konstanz
`-- https://scikon.uni-konstanz.de/personen/alexander.holupirek/
Written for BaseX 7.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery