Many XML with the same path
Thursday, 7 June 2012 · 7 messages · last reply 21 Jun 2012
CG
Quoted text · Henrique Oliveira · 1 line
> Why am I able to add/store several XML with the same path?
The REPLACE command [1,2] will remove existing versions of a document. Christian
[1] http://docs.basex.org/wiki/Commands#REPLACE
[2] http://docs.basex.org/wiki/Database_Module#db:replace
HO
Henrique Oliveira7 Jun 2012 03:37 #
Hi guys,
Why am I able to add/store several XML with the same path?
<rest:database xmlns:rest="http://basex.org/rest" name="TRADES" resources="9
">
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique1.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique3.xml</rest:resource>
</rest:database>--
Henrique Oliveira
CG
Quoted text · Henrique Oliveira · 3 lines
> Shouldn't have a 'constraint' to avoid replacing a file? > so if the path exists you can use REPLACE but not > ADD or STORE cmd
I'm sorry I'm not sure what you want to know. Could you give more details? Christian
CG
Quoted text · Henrique Oliveira · 1 line
> Shouldn't be BaseX block it?
You mean that BaseX should not allow adding multiple resources with the same path? There is indeed one open GitHub issue for that:
https://github.com/BaseXdb/basex/issues/429
One advantage of the current solution is that new documents can be added extremely fast – exactly because of the missing duplicate check. The main challenge of resolving issue 429 will be to ensure that performance won't suffer too much.
HO
Shouldn't have a 'constraint' to avoid replacing a file?
so if the path exists you can use REPLACE but not
ADD or STORE cmd
2012/6/6 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 8 lines
> > Why am I able to add/store several XML with the same path? > > The REPLACE command [1,2] will remove existing versions of a document. > Christian > > [1] http://docs.basex.org/wiki/Commands#REPLACE > [2] http://docs.basex.org/wiki/Database_Module#db:replace >
--
Henrique Oliveira
HO
Why am I able to add/store several XML with the same path?
<rest:database xmlns:rest="http://basex.org/rest" name="TRADES" resources="9
">
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique1.xml</rest:resource>
<rest:resource type="xml" content-type="application/xml" size="3">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique2.xml</rest:resource>
<rest:resource type="raw" content-type="application/xml" size="21">
henrique3.xml</rest:resource>
</rest:database>Shouldn't be BaseX block it?
2012/6/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 7 lines
> > Shouldn't have a 'constraint' to avoid replacing a file? > > so if the path exists you can use REPLACE but not > > ADD or STORE cmd > > I'm sorry I'm not sure what you want to know. Could you give more details? > Christian >
--
Henrique Oliveira
HO
In my opinion it is a critical issue..
should have a way to avoid this..
Regards
2012/6/20 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 12 lines
> > Shouldn't be BaseX block it? > > You mean that BaseX should not allow adding multiple resources with > the same path? There is indeed one open GitHub issue for that: > > https://github.com/BaseXdb/basex/issues/429 > > One advantage of the current solution is that new documents can be > added extremely fast – exactly because of the missing duplicate check. > The main challenge of resolving issue 429 will be to ensure that > performance won't suffer too much. >
--
Henrique Oliveira
Written for BaseX 7.2, 7.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery