Allow to add entries to context#27
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
==========================================
+ Coverage 94.78% 94.86% +0.07%
==========================================
Files 15 15
Lines 1035 1051 +16
==========================================
+ Hits 981 997 +16
Misses 54 54 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This pull request adds support for specifying extra JSON-LD vocabulary mappings (prefixes) via the
--extra-contextCLI option and corresponding programmatic APIs. It introduces new tests to ensure correct handling, serialization, round-tripping, and CLI integration of these extra context entries. The changes ensure that extra context mappings are always appended to the base context, are preserved across save/load operations, and are accessible both via the CLI and the Python interface.CLI and API support for extra context:
--extra-context(-c) CLI option to allow users to specify additional JSON-LD prefix-to-URI mappings (e.g.,ex=http://example.org/), with validation to ensure correct format. This is integrated into the main CLI and relevant subcommands, and is also available via theTROPython API. [1] [2] [3] [4] [5] [6] [7] [8]Model and serialization changes:
TransparentResearchObjectmodel to include anextra_contextfield, ensuring that extra context entries are appended to the base@contextduring JSON-LD serialization, and are properly extracted when loading from JSON-LD. [1] [2] [3] [4]Testing improvements: