Versioned parsers/serializers/translators + central registry + upgrades through generic queries (IR)#62
Merged
geritwagner merged 25 commits intomainfrom Sep 9, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a versioned architecture for parsers, serializers, and translators (e.g.,
pubmed/v1,wos/v1,ebsco/v1) alongside a central registry that resolves the latest implementation per platform at runtime. It also lays the groundwork for IR-based upgrades (generic intermediate representation) and adds linter guidance for deprecated syntax.Context
Addresses reviewer concerns (search-query-paper #54) about backward compatibility when database syntaxes evolve. Rather than saving queries redundantly in a structured format, we pin and store the syntax version with each saved query and provide a maintainable path to upgrade queries between versions.
Design
Versioned modules: Parsers, serializers, and translators are versioned independently.
Central registry & latest resolution (parser, serializer, translator):
SERIALIZERS: dict[str, dict[str, type[StringSerializer]]]keyed by semantic version.LATEST_SERIALIZERSselects the newest per platform usingpackaging.version.Version.Generic query objects serve as Intermediate Representations (IR) for upgrades and cross-platform translations.
Linters: Added platform-specific “deprecated-syntax” messages, so users receive actionable hints when their query uses outdated constructs.
Repository layout
Adopts a layout that scales with multiple versions and keeps code readable:
Version policy
Backward compatibility & migration
Saved queries should include:
{ "platform": "Web of Science", "search_string": "TS=(quantum AND dot AND spin)", "version": "1" }On load, the dispatcher resolves the requested (or latest) version; IR-based upgrade paths convert older versions forward.
Testing
Optional user workflow