-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure out how to do merge importing... #10
Comments
I don't know of a better way to do this. We have discussed discriminating by language tags in the description identifier (i.e. Checking for the 'manual designator' on replace would take hacking the persistence code, wouldn't it? |
I would rather put this create/merge/replace logic in the importers. I still can't think of a general way to merge the trees without appropriate knowledge of what it is we're merging. Can you write an XSLT to merge the Cegesoma multilingual EADs prior to import? I'm going to do some experimenting to try and figure this out. |
I've been looking around the handlers to understand how multilingual stuff is imported currently and to me it seems that one Map per language is created although how the language of the description is determined is unclear. Merging is one option, 'caching' the language of description is what I was thinking of. I just started 'caching' the |
I don't understand it either - out of interest I tried putting I'm working on something where two bundles (such as the existing one and the one we're importing) can be merged via a strategy that can be provided (via a function object) to determine whether nodes at the same level of the tree should be preserved or replaced. Then we should be able to do something like:
Then we could do: build import bundle from XML
if item exists:
get existing item bundle
merge via above strategy
update
else:
create |
Now added a |
We've made progress on this issue. Instead of (?) the Will look again soon. |
This is in theory working |
At present,
Description
nodes have a dependent relationship the their parent item. This means that if youcreateOrUpdate
an item bundle (as we do when importing from EAD) all descriptions that are not present in the input bundle will be deleted. This is an unavoidable consequence of having to update a full subtree (or at least I can't figure out how to do it otherwise.) The corollary is that descriptions are deleted when an item is deleted, like an SQL CASCADE.This will obviously cause problems in the case where additional descriptions are created manually via the web interface, on items that were harvested. Those manually created descriptions will be zapped if/when we re-harvest, because they don't belong in the source data.
The way I think we should handle this (without putting egregious hacks in the core persistence code) is as follows:
Because the existing descriptions won't have changed they won't actually be "updated", since the persistence code checks if any changes have actually occurred. However they also won't be deleted.
What do you think @bencomp and @lindareijnhoudt ?
The text was updated successfully, but these errors were encountered: