Skip to content

Implement agnostic merger #338

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

Open
5 tasks
sdruskat opened this issue May 5, 2025 · 2 comments
Open
5 tasks

Implement agnostic merger #338

sdruskat opened this issue May 5, 2025 · 2 comments
Labels
data model Related to the hermes data model

Comments

@sdruskat
Copy link
Contributor

sdruskat commented May 5, 2025

  • Implement a single merger class (working title ModelMerger) that merges 2 JSON-LD dictionaries (merge(source: expanded_json_ld, into: expanded_json_ld)).
  • Make configurable with a strategy, via a config file (or, e.g., table in hermes.toml) and via the API.
  • Refactor merge.py and path.py accordingly
  • Strategy is an abstract class, of which instances map types/fields to treatments (requires Implement merging strategy API #339)
  • Treatments provide logic to merge values of the given type/field (requires Implement fundamental "treatments" #340 )

This is a good case for using TDD.

@sdruskat sdruskat added the data model Related to the hermes data model label May 5, 2025
@led02
Copy link
Member

led02 commented May 5, 2025

Being a child of the 80s having grown up with Intel assembler, op(dst, src) feels so much more natural. Also: does that mean source will be modified during the process?

@sdruskat
Copy link
Contributor Author

sdruskat commented May 6, 2025

Being a child of the 80s having grown up with Intel assembler, op(dst, src) feels so much more natural. Also: does that mean source will be modified during the process?

Point taken (although you're not that old), naming isn't final.

E.g., I think the class should not be called just Merger, but ModelMerger or similar while "treatments" should be called ValueMerger or similar, to differentiate the two levels of merging (complete models vs. single types/fields).

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

No branches or pull requests

2 participants