Problem with db:create and addraw
Sunday, 15 September 2019 · 6 messages · last reply 18 Sep 2019
LV
Lizzi, Vincent15 Sep 2019 21:46 #
Greetings,
I am seeing different behavior between XQuery
db:create() and the command CREATE DB when trying to create a database from a zip file, which is causing a problem. I want to import a zip file that contains XML and binary files (images, ets.) into a new BaseX database using db:create() in a web app.
The command "CREATE DB" works as expected. For example, after running this script all contents of the zip file, including XML and binary files, are stored in a new database named "test".SET ADDRAW true
SET ADDARCHIVES true
SET ARCHIVENAME false
CREATE DB test C:\path\to\file.zipThe XQuery function
db:create() is not working correctly. The following query should be equivalent to the above command script, however binary files get placed in a new folder that is created in the folder where BaseX was launch, and the binary files cannot be accessed through BaseX. The binary files should be placed in a "raw" folder within the folder for the database within BaseX' s data directory the same as what CREATE DB produces.
db:create('test', ' C:\path\to\file.zip ', (), map{
'addraw': 'true',
'addarchives': 'true',
'archivename': 'false'
})
I've tried this in BaseX versions 9.0.2 and 9.2.4, both produce the same results.
Is there a way to resolve this problem?
Thanks,
Vincent
Vincent M. Lizzi - Digital Production Manager
Taylor & Francis Group
530 Walnut St., Suite 850, Philadelphia, PA 19106
E-Mail: vincent.lizzi at taylorandfrancis.com<mailto:vincent.lizzi at taylorandfrancis.com> Phone: 215-606-4221
Web: http://www.tandfonline.com/
Taylor & Francis is a trading name of Informa UK Limited,
registered in England under no. 1072954
"Everything should be made as simple as possible, but not simpler."
Information Classification: GeneralCG
Christian Grün15 Sep 2019 21:55 #
Hi Vincent,
Thanks for sharing your observation. Just recently, we have stumbled upon this bug by ourselves; it should be fixed with 9.3 [1].
Cheers,
Christian
[1] https://github.com/BaseXdb/basex/issues/1717
Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> schrieb am So., 15. Sep. 2019, 21:47:
Quoted text · Lizzi, Vincent · 96 lines
> Greetings, > > > > I am seeing different behavior between XQuery db:create() and the command > CREATE DB when trying to create a database from a zip file, which is > causing a problem. I want to import a zip file that contains XML and binary > files (images, ets.) into a new BaseX database using db:create() in a web > app. > > > > The command “CREATE DB” works as expected. For example, after running this > script all contents of the zip file, including XML and binary files, are > stored in a new database named “test”. > > > > SET ADDRAW true > > SET ADDARCHIVES true > > SET ARCHIVENAME false > > CREATE DB test C:\path\to\file.zip > > > > The XQuery function db:create() is not working correctly. The following > query should be equivalent to the above command script, however binary > files get placed in a new folder that is created in the folder where BaseX > was launch, and the binary files cannot be accessed through BaseX. The > binary files should be placed in a “raw” folder within the folder for the > database within BaseX’ s data directory the same as what CREATE DB produces. > > > > db:create('test', ' C:\path\to\file.zip ', (), map{ > > 'addraw': 'true', > > 'addarchives': 'true', > > 'archivename': 'false' > > }) > > > > > > I’ve tried this in BaseX versions 9.0.2 and 9.2.4, both produce the same > results. > > > > Is there a way to resolve this problem? > > > > Thanks, > > Vincent > > > > > > > > Vincent M. Lizzi - Digital Production Manager > > Taylor & Francis Group > > 530 Walnut St., Suite 850, Philadelphia, PA 19106 > > E-Mail: vincent.lizzi at taylorandfrancis.com > > Phone: 215-606-4221 > > Web: http://www.tandfonline.com/ > > > > Taylor & Francis is a trading name of Informa UK Limited, > > registered in England under no. 1072954 > > > > "Everything should be made as simple as possible, but not simpler." > > > > Information Classification: General >
LV
Lizzi, Vincent15 Sep 2019 23:11 #
Hi Christian,
It is good to hear that problem this is already known and will be fixed soon. As a possible workaround or now, is there a way to run a command script from XQuery that would enable using CREATE DB from XQuery?
Thanks!
Vincent
Quoted text · Christian Grün · 39 lines
From: Christian Grün <christian.gruen at gmail.com> Sent: Sunday, September 15, 2019 8:56 PM To: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] Problem with db:create and addraw Hi Vincent, Thanks for sharing your observation. Just recently, we have stumbled upon this bug by ourselves; it should be fixed with 9.3 [1]. Cheers, Christian [1] https://github.com/BaseXdb/basex/issues/1717<https://github.com/BaseXdb/basex/issues/1717> Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com<mailto:Vincent.Lizzi at taylorandfrancis.com>> schrieb am So., 15. Sep. 2019, 21:47: Greetings, I am seeing different behavior between XQuery db:create() and the command CREATE DB when trying to create a database from a zip file, which is causing a problem. I want to import a zip file that contains XML and binary files (images, ets.) into a new BaseX database using db:create() in a web app. The command "CREATE DB" works as expected. For example, after running this script all contents of the zip file, including XML and binary files, are stored in a new database named "test". SET ADDRAW true SET ADDARCHIVES true SET ARCHIVENAME false CREATE DB test C:\path\to\file.zip The XQuery function db:create() is not working correctly. The following query should be equivalent to the above command script, however binary files get placed in a new folder that is created in the folder where BaseX was launch, and the binary files cannot be accessed through BaseX. The binary files should be placed in a "raw" folder within the folder for the database within BaseX' s data directory the same as what CREATE DB produces. db:create('test', ' C:\path\to\file.zip ', (), map{ 'addraw': 'true', 'addarchives': 'true', 'archivename': 'false' }) I've tried this in BaseX versions 9.0.2 and 9.2.4, both produce the same results. Is there a way to resolve this problem? Thanks, Vincent Vincent M. Lizzi - Digital Production Manager Taylor & Francis Group 530 Walnut St., Suite 850, Philadelphia, PA 19106 E-Mail: vincent.lizzi at taylorandfrancis.com<mailto:vincent.lizzi at taylorandfrancis.com> Phone: 215-606-4221 Web: http://www.tandfonline.com/<http://www.tandfonline.com/> Taylor & Francis is a trading name of Informa UK Limited, registered in England under no. 1072954 "Everything should be made as simple as possible, but not simpler." Information Classification: General Information Classification: General
CG
Christian Grün16 Sep 2019 11:58 #
Hi Vincent,
Quoted text · Lizzi, Vincent · 1 line
> It is good to hear that problem this is already known and will be fixed soon. As a possible workaround or now, is there a way to run a command script from XQuery that would enable using CREATE DB from XQuery?
Currently no. We didn’t enable script execution from XQuery because it might introduce too many new and complex side effects. For now, you’ll have to create your database in a first step and add resources via db:store and
db:add in a subsequent step.
BaseX 9.3 is expected to be released by end of September or mid-October.
Cheers,
ChristianQuoted text · Lizzi, Vincent · 127 lines
> From: Christian Grün <christian.gruen at gmail.com> > Sent: Sunday, September 15, 2019 8:56 PM > To: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] Problem with db:create and addraw > > > > Hi Vincent, > > > > Thanks for sharing your observation. Just recently, we have stumbled upon this bug by ourselves; it should be fixed with 9.3 [1]. > > > > Cheers, > > Christian > > > > > > [1] https://github.com/BaseXdb/basex/issues/1717 > > > > > > > > > > > > Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> schrieb am So., 15. Sep. 2019, 21:47: > > Greetings, > > > > I am seeing different behavior between XQuery db:create() and the command CREATE DB when trying to create a database from a zip file, which is causing a problem. I want to import a zip file that contains XML and binary files (images, ets.) into a new BaseX database using db:create() in a web app. > > > > The command “CREATE DB” works as expected. For example, after running this script all contents of the zip file, including XML and binary files, are stored in a new database named “test”. > > > > SET ADDRAW true > > SET ADDARCHIVES true > > SET ARCHIVENAME false > > CREATE DB test C:\path\to\file.zip > > > > The XQuery function db:create() is not working correctly. The following query should be equivalent to the above command script, however binary files get placed in a new folder that is created in the folder where BaseX was launch, and the binary files cannot be accessed through BaseX. The binary files should be placed in a “raw” folder within the folder for the database within BaseX’ s data directory the same as what CREATE DB produces. > > > > db:create('test', ' C:\path\to\file.zip ', (), map{ > > 'addraw': 'true', > > 'addarchives': 'true', > > 'archivename': 'false' > > }) > > > > > > I’ve tried this in BaseX versions 9.0.2 and 9.2.4, both produce the same results. > > > > Is there a way to resolve this problem? > > > > Thanks, > > Vincent > > > > > > > > Vincent M. Lizzi - Digital Production Manager > > Taylor & Francis Group > > 530 Walnut St., Suite 850, Philadelphia, PA 19106 > > E-Mail: vincent.lizzi at taylorandfrancis.com > > Phone: 215-606-4221 > > Web: http://www.tandfonline.com/ > > > > Taylor & Francis is a trading name of Informa UK Limited, > > registered in England under no. 1072954 > > > > "Everything should be made as simple as possible, but not simpler." > > > > > > Information Classification: General > > > > Information Classification: General
CG
Christian Grün17 Sep 2019 13:58 #
Hi Vincent,
The fix for adding binary resources via XQuery is available. I’d appreciate if you could give it a quick shot [1].
Thanks in advance,
Christian
[1] http://files.basex.org/releases/latest/
Quoted text · Christian Grün · 145 lines
On Mon, Sep 16, 2019 at 11:58 AM Christian Grün <christian.gruen at gmail.com> wrote: > > Hi Vincent, > > > It is good to hear that problem this is already known and will be fixed soon. As a possible workaround or now, is there a way to run a command script from XQuery that would enable using CREATE DB from XQuery? > > Currently no. We didn’t enable script execution from XQuery because it > might introduce too many new and complex side effects. For now, you’ll > have to create your database in a first step and add resources via > db:store and db:add in a subsequent step. > > BaseX 9.3 is expected to be released by end of September or mid-October. > > Cheers, > Christian > > > > From: Christian Grün <christian.gruen at gmail.com> > > Sent: Sunday, September 15, 2019 8:56 PM > > To: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> > > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > > Subject: Re: [basex-talk] Problem with db:create and addraw > > > > > > > > Hi Vincent, > > > > > > > > Thanks for sharing your observation. Just recently, we have stumbled upon this bug by ourselves; it should be fixed with 9.3 [1]. > > > > > > > > Cheers, > > > > Christian > > > > > > > > > > > > [1] https://github.com/BaseXdb/basex/issues/1717 > > > > > > > > > > > > > > > > > > > > > > > > Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> schrieb am So., 15. Sep. 2019, 21:47: > > > > Greetings, > > > > > > > > I am seeing different behavior between XQuery db:create() and the command CREATE DB when trying to create a database from a zip file, which is causing a problem. I want to import a zip file that contains XML and binary files (images, ets.) into a new BaseX database using db:create() in a web app. > > > > > > > > The command “CREATE DB” works as expected. For example, after running this script all contents of the zip file, including XML and binary files, are stored in a new database named “test”. > > > > > > > > SET ADDRAW true > > > > SET ADDARCHIVES true > > > > SET ARCHIVENAME false > > > > CREATE DB test C:\path\to\file.zip > > > > > > > > The XQuery function db:create() is not working correctly. The following query should be equivalent to the above command script, however binary files get placed in a new folder that is created in the folder where BaseX was launch, and the binary files cannot be accessed through BaseX. The binary files should be placed in a “raw” folder within the folder for the database within BaseX’ s data directory the same as what CREATE DB produces. > > > > > > > > db:create('test', ' C:\path\to\file.zip ', (), map{ > > > > 'addraw': 'true', > > > > 'addarchives': 'true', > > > > 'archivename': 'false' > > > > }) > > > > > > > > > > > > I’ve tried this in BaseX versions 9.0.2 and 9.2.4, both produce the same results. > > > > > > > > Is there a way to resolve this problem? > > > > > > > > Thanks, > > > > Vincent > > > > > > > > > > > > > > > > Vincent M. Lizzi - Digital Production Manager > > > > Taylor & Francis Group > > > > 530 Walnut St., Suite 850, Philadelphia, PA 19106 > > > > E-Mail: vincent.lizzi at taylorandfrancis.com > > > > Phone: 215-606-4221 > > > > Web: http://www.tandfonline.com/ > > > > > > > > Taylor & Francis is a trading name of Informa UK Limited, > > > > registered in England under no. 1072954 > > > > > > > > "Everything should be made as simple as possible, but not simpler." > > > > > > > > > > > > Information Classification: General > > > > > > > > Information Classification: General
LV
Lizzi, Vincent18 Sep 2019 00:12 #
Hi Christian,
Testing again with the latest 9.3-SNAPSHOT, when using
db:create() the raw files in the .zip archive are being placed in the correct location. Thank you for the speedy solution!
Vincent
Information Classification: GeneralQuoted text · Christian Grün · 156 lines
From: Christian Grün <christian.gruen at gmail.com> Sent: Tuesday, September 17, 2019 12:59 PM To: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] Problem with db:create and addraw Hi Vincent, The fix for adding binary resources via XQuery is available. I'd appreciate if you could give it a quick shot [1]. Thanks in advance, Christian [1] http://files.basex.org/releases/latest/<http://files.basex.org/releases/latest/> On Mon, Sep 16, 2019 at 11:58 AM Christian Grün <christian.gruen at gmail.com<mailto:christian.gruen at gmail.com>> wrote: > > Hi Vincent, > > > It is good to hear that problem this is already known and will be fixed soon. As a possible workaround or now, is there a way to run a command script from XQuery that would enable using CREATE DB from XQuery? > > Currently no. We didn't enable script execution from XQuery because it > might introduce too many new and complex side effects. For now, you'll > have to create your database in a first step and add resources via > db:store and db:add in a subsequent step. > > BaseX 9.3 is expected to be released by end of September or mid-October. > > Cheers, > Christian > > > > From: Christian Grün <christian.gruen at gmail.com<mailto:christian.gruen at gmail.com>> > > Sent: Sunday, September 15, 2019 8:56 PM > > To: Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com<mailto:Vincent.Lizzi at taylorandfrancis.com>> > > Cc: BaseX <basex-talk at mailman.uni-konstanz.de<mailto:basex-talk at mailman.uni-konstanz.de>> > > Subject: Re: [basex-talk] Problem with db:create and addraw > > > > > > > > Hi Vincent, > > > > > > > > Thanks for sharing your observation. Just recently, we have stumbled upon this bug by ourselves; it should be fixed with 9.3 [1]. > > > > > > > > Cheers, > > > > Christian > > > > > > > > > > > > [1] https://github.com/BaseXdb/basex/issues/1717<https://github.com/BaseXdb/basex/issues/1717> > > > > > > > > > > > > > > > > > > > > > > > > Lizzi, Vincent <Vincent.Lizzi at taylorandfrancis.com<mailto:Vincent.Lizzi at taylorandfrancis.com>> schrieb am So., 15. Sep. 2019, 21:47: > > > > Greetings, > > > > > > > > I am seeing different behavior between XQuery db:create() and the command CREATE DB when trying to create a database from a zip file, which is causing a problem. I want to import a zip file that contains XML and binary files (images, ets.) into a new BaseX database using db:create() in a web app. > > > > > > > > The command "CREATE DB" works as expected. For example, after running this script all contents of the zip file, including XML and binary files, are stored in a new database named "test". > > > > > > > > SET ADDRAW true > > > > SET ADDARCHIVES true > > > > SET ARCHIVENAME false > > > > CREATE DB test C:\path\to\file.zip > > > > > > > > The XQuery function db:create() is not working correctly. The following query should be equivalent to the above command script, however binary files get placed in a new folder that is created in the folder where BaseX was launch, and the binary files cannot be accessed through BaseX. The binary files should be placed in a "raw" folder within the folder for the database within BaseX' s data directory the same as what CREATE DB produces. > > > > > > > > db:create('test', ' C:\path\to\file.zip ', (), map{ > > > > 'addraw': 'true', > > > > 'addarchives': 'true', > > > > 'archivename': 'false' > > > > }) > > > > > > > > > > > > I've tried this in BaseX versions 9.0.2 and 9.2.4, both produce the same results. > > > > > > > > Is there a way to resolve this problem? > > > > > > > > Thanks, > > > > Vincent > > > > > > > > > > > > > > > > Vincent M. Lizzi - Digital Production Manager > > > > Taylor & Francis Group > > > > 530 Walnut St., Suite 850, Philadelphia, PA 19106 > > > > E-Mail: vincent.lizzi at taylorandfrancis.com<mailto:vincent.lizzi at taylorandfrancis.com> > > > > Phone: 215-606-4221 > > > > Web: http://www.tandfonline.com/<http://www.tandfonline.com/> > > > > > > > > Taylor & Francis is a trading name of Informa UK Limited, > > > > registered in England under no. 1072954 > > > > > > > > "Everything should be made as simple as possible, but not simpler." > > > > > > > > > > > > Information Classification: General > > > > > > > > Information Classification: General
Written for BaseX 9.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery