Skip to content
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

Supporting merging records #1609

Closed
4 tasks done
kaplun opened this issue Sep 27, 2016 · 5 comments
Closed
4 tasks done

Supporting merging records #1609

kaplun opened this issue Sep 27, 2016 · 5 comments
Assignees

Comments

@kaplun
Copy link
Contributor

kaplun commented Sep 27, 2016

In legacy when a record A is merged into a record B, A is tagged as deleted (980__c is set to DELETED) the recid of B is copied into 970__d and when a user visit record A she is redirected to record B.

We need to implement the same behavior on master, and migrate existing merged information. I.e.:

  • We need to add to all schemas (when missing) a new field:
"new_record": {
            "$ref": "elements/json_reference.json",
            "description": "Master record that replaces this record",
            "title": "New record"
        },
  • We need to add rules for dojson that copy 970__d into the proper URL in the above field. (e.g. http://localhost:5000/literature/1234)
  • We need to capture upon record insertion/update (i.e. with a receiver) when need to amend all the PIDs pointing to record A and make them redirect to record B.
  • BONUS POINT: schedule a task that look for all the records that were pointing to A and update them to point to B. Yay! (Actually see Merging records should propagate links #484)
@jacquerie
Copy link
Contributor

  • We need to add to all schemas a new field:
        "merged_into_record": {
            "$ref": "elements/json_reference.json"
        },

Note that in some cases the schema already contains something like this, like here, so you should be careful of not duplicating this information in two fields.

Note also that this is "blocked" by inspirehep/inspire-schemas#1. "Blocked" in the sense that this may proceed, but after that PR is merged the schema modifications will have to be split there before merging.

@kaplun
Copy link
Contributor Author

kaplun commented Sep 27, 2016

See:
https://gist.github.com/kaplun/fe17d07b6ece96d137b60fcdae45b6fc

for an example of the original MARCXML.

@kaplun
Copy link
Contributor Author

kaplun commented Sep 27, 2016

Note that in some cases the schema already contains something like this, like here, so you should be careful of not duplicating this information in two fields.

Right! That has to disappear. That field does not make sense because you don't want to have the merged record to point back to the deleted ones. It's a legacy information of legacy. Really really legacy 💃

You are right 👍

@kaplun
Copy link
Contributor Author

kaplun commented Sep 27, 2016

I was actually thinking that deleted_records (i.e. 981) should not be needed. But indeed we need it as long as legacy exist. Otherwise we risk to throw away info.

spirosdelviniotis added a commit to spirosdelviniotis/inspire-schemas that referenced this issue Oct 7, 2016
* NEW added 'new_record' field for all the json schemas regarding merged records.
* Fix issue #1609 for inspirehep/inspire-next#1609.

Signed-off-by: Spiros Delviniotis <spyridon.delviniotis@cern.ch>
spirosdelviniotis added a commit to spirosdelviniotis/inspire-schemas that referenced this issue Oct 7, 2016
* NEW Adds 'new_record' field for all the json schemas regarding merged records.
* Addresses inspirehep/inspire-next#1609.

Signed-off-by: Spiros Delviniotis <spyridon.delviniotis@cern.ch>
spirosdelviniotis added a commit to spirosdelviniotis/inspire-schemas that referenced this issue Oct 7, 2016
* NEW Adds 'new_record' field for all the json schemas regarding merged records.
* Addresses inspirehep/inspire-next#1609.

Signed-off-by: Spiros Delviniotis <spyridon.delviniotis@cern.ch>
@jacquerie
Copy link
Contributor

Done in #1790.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants