-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add more checks & extend validation. Support vocabulary configuration. #131
Conversation
This file contains 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
setup_logging did not correctly initialize a basic config.
This also changes the structure of the config. All vocabularies are stored under a common namespace "vocabs".
Tests are not yet included. test_checks.py is only a template. Other changes: - add type annotation for class vars in fields.py
Some validations use parameter from idranges.toml if present. Other changes - renamed home_vocab_uri to source_vocab (to match xlsx template) - add vocab_name to parameter list of extract-functions to enable validations that need to lookup vocabulary-specific options in config
This removes CURIE to URI conversion from convert_043.py
Added tests for logging to test_config.py
This was referenced Jul 19, 2023
This was referenced Jul 20, 2023
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 PR adds several checks that are run when converting vocabularies. Validation is now also much stricter (#130). Some code could be removed by making better use of pydantic's features, e.g. the conversion from CURIE to URI (prefix expansion) happens now as part of the model validation.
A config-module to share a common configuration across all modules of voc4cat had to be added first. Sharing is done by importing
config.py
where needed.config.py
reads the config-file (idranges.toml
) upon import. The config is also represented as pydantic model and validated. For thorough validation, the PR adds pydantic model fields for ORCID and ROR.The content of id_ranges.toml was extended and the format was adjusted. The file format should be more stable from now on.
General checks that do not need a config:
str
. Values that are not URLs will be rejected.Checks that require a config (
idranges.toml
):permanent_iri_part
).Checks for running on PRs in gh-actions (also require a config):
Theses checks are useful to maintain SKOS-vocabularies with NFDI4Cat/voc4cat-template.
single_vocab = true
, it is checked that the inbox has not more than one file.allow_delete
parameter).Still to do:
Closes #116