-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature/lxl 4610 allow dead links in bulk change spec #1552
Feature/lxl 4610 allow dead links in bulk change spec #1552
Conversation
whelk-core/src/main/groovy/whelk/component/PostgreSQLComponent.groovy
Outdated
Show resolved
Hide resolved
whelktool/src/main/groovy/whelk/datatool/form/ModifiedThing.groovy
Outdated
Show resolved
Hide resolved
whelk-core/src/main/groovy/whelk/component/PostgreSQLComponent.groovy
Outdated
Show resolved
Hide resolved
whelk-core/src/main/groovy/whelk/component/PostgreSQLComponent.groovy
Outdated
Show resolved
Hide resolved
758c7fb
to
1b22ecd
Compare
} | ||
if (data instanceof Map) { | ||
// Keep original ID for "weak relations" | ||
if (isLink(data) && !JsonLd.isWeak(propertyPath.join("."))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will not return here if it is weak link.
i.e. the loop below will be run for weak links
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments about HTTP status code and replaceSameAsLinksWithPrimaries
Other than that, LGTM!
1b22ecd
to
55e5f1a
Compare
- Prevent new links to deleted resources within XL from ever being created, sameAs excepted. - Records may, in general, not be deleted if they are referenced by other records. - Declare some relations as "weak". A record may be deleted if only referenced by these relations. - For weak relations, keep original ID on normalization. - Refactor and clean up
55e5f1a
to
a6e9053
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
To be able to delete records referenced in a bulk change specification, allow any property inside a
bulk:ChangeSpec
(i.e. the object ofbulk:changeSpec
to hold links to deleted resources. We already have a similar mechanism for exact paths, seelibrisxl/whelk-core/src/main/groovy/whelk/JsonLd.groovy
Line 59 in a56f059
This should not however be hardcoded but rather defined in the vocab (TODO).
See https://kbse.atlassian.net/browse/LXL-4610 for more info.
I sneaked in another commit too (a56f059) that is unrelated to the above. When the data in a record is not compatible with the operations specified in a
bulk:ChangeSpec
of abulk:Update
, the record is just ignored and won't be affected by the job. This can happen for example when trying to add another value to a property that is not repeatable.