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

Feature/lxl 4610 allow dead links in bulk change spec #1552

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

kwahlin
Copy link
Contributor

@kwahlin kwahlin commented Feb 10, 2025

To be able to delete records referenced in a bulk change specification, allow any property inside a bulk:ChangeSpec (i.e. the object of bulk:changeSpec to hold links to deleted resources. We already have a similar mechanism for exact paths, see

public static final List<String> ALLOW_LINK_TO_DELETED = [
).
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 a bulk: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.

jannistsiroyannis

This comment was marked as outdated.

@kwahlin kwahlin force-pushed the feature/lxl-4610-allow-dead-links-in-bulk-changeSpec branch from 758c7fb to 1b22ecd Compare February 25, 2025 12:34
}
if (data instanceof Map) {
// Keep original ID for "weak relations"
if (isLink(data) && !JsonLd.isWeak(propertyPath.join("."))) {
Copy link
Contributor

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

Copy link
Contributor

@olovy olovy left a 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!

@kwahlin kwahlin force-pushed the feature/lxl-4610-allow-dead-links-in-bulk-changeSpec branch from 1b22ecd to 55e5f1a Compare February 25, 2025 14:25
- 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
@kwahlin kwahlin force-pushed the feature/lxl-4610-allow-dead-links-in-bulk-changeSpec branch from 55e5f1a to a6e9053 Compare February 25, 2025 14:53
Copy link
Contributor

@olovy olovy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@olovy olovy merged commit 3b35242 into develop Feb 25, 2025
1 check passed
@olovy olovy deleted the feature/lxl-4610-allow-dead-links-in-bulk-changeSpec branch February 25, 2025 15:06
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

Successfully merging this pull request may close these issues.

3 participants