Hi Eliot,
XQuery Maps are very efficient, but they are mostly useful for ad-hoc queries.
If you want to create an additional persistent data structure, I would probably create a database in order to benefit from the standard index structures. db:node-id can be helpful indeed. See e.g. [1] for a little example.
Best, Christian
[1] https://docs.basex.org/wiki/Indexes#Custom_Index_Structures
I have large maps that include nodes as entry values. I want to persist these maps in the DB for subsequent retrieval.
I believe the best/only strategy is:
Construct a new map where each node in a value is replaced by its node-id() value. Serialize the map to JSON and store as a blob
To reconstitute it, do the reverse (parse JSON into map, replace node-ids() with nodes).
Is my analysis correct? Have I missed any detail or better approach?
Thanks,
Eliot