Return file source of a given node?
Friday, 28 February 2014 · 5 messages
HE
Hondros, Constantine (ELS-AMS)28 Feb 2014 11:35 #
Hello all,
So, I am using Basex to inspect a gargantuan archive of XML records split over thousands of .tar files (thanks Christian for the recent fix allowing me to create a DB from tar input!).
In some cases, I would like to know which file, in which tar archive, was the source for a given query result. Imagine that my DB consists of thousands of documents with root element <article>. Is there any way to return the file path of the document that was the source for result of this sort of simple query?
/article[@id = '123']
Thanks,
Constantine
________________________________
Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.
AG
Arve Gengelbach28 Feb 2014 11:51 #
Hi Constantine,
the query
/article[@id = '123']/base-uri()
should return for each matching article the name of document in the database or name of file on disk.
cheers
Arve
Quoted text · Constantine (ELS-AMS) · 17 lines
On 28 Feb 2014, at 11:35, Hondros, Constantine (ELS-AMS) <C.Hondros at elsevier.com> wrote: > Hello all, > > So, I am using Basex to inspect a gargantuan archive of XML records split over thousands of .tar files (thanks Christian for the recent fix allowing me to create a DB from tar input!). > > In some cases, I would like to know which file, in which tar archive, was the source for a given query result. Imagine that my DB consists of thousands of documents with root element <article>. Is there any way to return the file path of the document that was the source for result of this sort of simple query? > > /article[@id = ‘123’] > > Thanks, > Constantine > > Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
FE
Fabrice Etanchaud28 Feb 2014 11:53 #
Hi Constantine,
db:path(your node) could also do it.Best regards
Fabrice
-----Message d'origine-----
Quoted text · Arve Gengelbach · 31 lines
De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Arve Gengelbach Envoyé : vendredi 28 février 2014 11:52 À : Hondros, Constantine (ELS-AMS) Cc : basex-talk at mailman.uni-konstanz.de Objet : Re: [basex-talk] Return file source of a given node? Hi Constantine, the query /article[@id = '123']/base-uri() should return for each matching article the name of document in the database or name of file on disk. cheers Arve On 28 Feb 2014, at 11:35, Hondros, Constantine (ELS-AMS) <C.Hondros at elsevier.com> wrote: > Hello all, > > So, I am using Basex to inspect a gargantuan archive of XML records split over thousands of .tar files (thanks Christian for the recent fix allowing me to create a DB from tar input!). > > In some cases, I would like to know which file, in which tar archive, was the source for a given query result. Imagine that my DB consists of thousands of documents with root element <article>. Is there any way to return the file path of the document that was the source for result of this sort of simple query? > > /article[@id = '123'] > > Thanks, > Constantine > > Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk BaseX-Talk mailing list BaseX-Talk at mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
HE
Hondros, Constantine (ELS-AMS)28 Feb 2014 12:33 #
Thanks - I should have guessed it would be so easy with Basex.
Cheers,
Constantine
Quoted text · Fabrice Etanchaud · 40 lines
-----Original Message----- From: Fabrice Etanchaud [mailto:fetanchaud at questel.com] Sent: 28 February 2014 11:53 To: Arve Gengelbach; Hondros, Constantine (ELS-AMS) Cc: basex-talk at mailman.uni-konstanz.de Subject: RE: [basex-talk] Return file source of a given node? Hi Constantine, db:path(your node) could also do it. Best regards Fabrice -----Message d'origine----- De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Arve Gengelbach Envoyé : vendredi 28 février 2014 11:52 À : Hondros, Constantine (ELS-AMS) Cc : basex-talk at mailman.uni-konstanz.de Objet : Re: [basex-talk] Return file source of a given node? Hi Constantine, the query /article[@id = '123']/base-uri() should return for each matching article the name of document in the database or name of file on disk. cheers Arve On 28 Feb 2014, at 11:35, Hondros, Constantine (ELS-AMS) <C.Hondros at elsevier.com> wrote: > Hello all, > > So, I am using Basex to inspect a gargantuan archive of XML records split over thousands of .tar files (thanks Christian for the recent fix allowing me to create a DB from tar input!). > > In some cases, I would like to know which file, in which tar archive, was the source for a given query result. Imagine that my DB consists of thousands of documents with root element <article>. Is there any way to return the file path of the document that was the source for result of this sort of simple query? > > /article[@id = '123'] > > Thanks, > Constantine > > Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk BaseX-Talk mailing list BaseX-Talk at mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.
FE
Fabrice Etanchaud28 Feb 2014 12:44 #
You are right,
People do not know how easily they could process their XML data...
-----Message d'origine-----
Quoted text · Hondros, Constantine (ELS-AMS) · 50 lines
De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Hondros, Constantine (ELS-AMS) Envoyé : vendredi 28 février 2014 12:34 À : basex-talk at mailman.uni-konstanz.de Objet : Re: [basex-talk] Return file source of a given node? Thanks - I should have guessed it would be so easy with Basex. Cheers, Constantine -----Original Message----- From: Fabrice Etanchaud [mailto:fetanchaud at questel.com] Sent: 28 February 2014 11:53 To: Arve Gengelbach; Hondros, Constantine (ELS-AMS) Cc: basex-talk at mailman.uni-konstanz.de Subject: RE: [basex-talk] Return file source of a given node? Hi Constantine, db:path(your node) could also do it. Best regards Fabrice -----Message d'origine----- De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Arve Gengelbach Envoyé : vendredi 28 février 2014 11:52 À : Hondros, Constantine (ELS-AMS) Cc : basex-talk at mailman.uni-konstanz.de Objet : Re: [basex-talk] Return file source of a given node? Hi Constantine, the query /article[@id = '123']/base-uri() should return for each matching article the name of document in the database or name of file on disk. cheers Arve On 28 Feb 2014, at 11:35, Hondros, Constantine (ELS-AMS) <C.Hondros at elsevier.com> wrote: > Hello all, > > So, I am using Basex to inspect a gargantuan archive of XML records split over thousands of .tar files (thanks Christian for the recent fix allowing me to create a DB from tar input!). > > In some cases, I would like to know which file, in which tar archive, was the source for a given query result. Imagine that my DB consists of thousands of documents with root element <article>. Is there any way to return the file path of the document that was the source for result of this sort of simple query? > > /article[@id = '123'] > > Thanks, > Constantine > > Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk BaseX-Talk mailing list BaseX-Talk at mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands. BaseX-Talk mailing list BaseX-Talk at mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Written for BaseX 7.8. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery