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

Even smarter merge for partial metadata #20

Open
apirogov opened this issue Aug 23, 2022 · 0 comments
Open

Even smarter merge for partial metadata #20

apirogov opened this issue Aug 23, 2022 · 0 comments
Labels
enhancement New feature or request internals Technical and subtle issues users are (usually) not aware of

Comments

@apirogov
Copy link
Collaborator

apirogov commented Aug 23, 2022

Specifically when using JSON LD, there is a difference between the semantic identity of objects and the available information.
Multiple pieces of information can refer to the same entity, witnessed by equal @id.

Currently, the "smart merge" of partial metadata would not combine two instances partial instances with same @id together when they appear in a list or set, because structurally they are different.

A general solution would be to define __identity_fields__ at MetadataSchema to be a tuple that, if present, defines the "semantic identity". In the case of JSON-LD-based schemas, we would simply set __identity_fields__ = ("id_",)

The smart merge then could be extended so that it would inspect objects in lists or sets, and instead of doing concat/set union as usual, for suitable objects (MetadataSchema with set __identity_fields__) it would instead combine them.

When this new special field is not set, each instance would be treated as a separate identity and never be merged with others.

On the other hand, it is not clear how useful this would be, as this presupposes that usually the @id for some given schema is something consistent either by force or convenion (e.g. ORCID of an author/Person, thus allowing to combine partial author information).

@apirogov apirogov added the idea label Aug 23, 2022
@apirogov apirogov added enhancement New feature or request and removed idea labels Sep 20, 2022
@apirogov apirogov added the internals Technical and subtle issues users are (usually) not aware of label Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internals Technical and subtle issues users are (usually) not aware of
Projects
None yet
Development

No branches or pull requests

1 participant