Christian,
I am absolutely new to database in general, though I understand relational database well enough. So, I appreciate your patience in walking me through this. Is there some book/resource you can point me to, which helps better visualize NXD ?
I follow your below email, but what I need to do is something like under:
1. Database, would have bunch of XML files associated to a particular "ID". I will make sure each start with a difference root. 2. Create a xml mapping file as you discussed below. 3. In one of my use case, I need XPATH query to return me all "ID", which matches XPATH. I am not able to go ahead with this use case.
Can you help me design this use case ?
- Mansi
On Mon, Oct 13, 2014 at 7:03 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Mansi,
I am storing deeply nested hierarchal data in XML files. Simply put,
most of
my queries are going to be relative (For e..g //@name). So, I am
assuming it
would be a huge performance hit. Specially, when I know each "ID" will
most
definitely have multiple XML documents. Correct me, if I am wrong here.
Usually, one identifier (ID) exists to reference one data entity (document, row, etc.). You say that more than one document will be assigned to a single ID, so you seem to work with 1:n relationships. For what does your ID stand for?
The notion of tables stems from the relational database world. In XML, you work with documents and collections, so it's a well-established procedure to reference documents by their database path. 1:n relationships can e.g. be represented in another database, which would contain a document with the following structure:
<docs> <doc id='0'>a.xml</doc> <doc id='0'>b.xml</doc> </docs>
A query like the following one could be used to address these documents:
for $doc in db:open('db-ids')//doc[@id = '0'] return db:open('db', $doc)
If your id database is indexed, access will be very fast (within fragments of milliseconds).
I agree it takes some time to understand the logics that I sketched out here, but once you are into it, it works out perfectly fine.
Hope this helps Christian