feat: generate biii dumps from versioned metadata - #55
Open
mihai-sysbio wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new dump generator to produce BIII-related TTL datasets from versioned metadata (in metadata-commons), rather than fetching live data, aligning dump generation with the repo-based publishing pipeline.
Changes:
- Added a new
bioschemas-gen/biii_bioschemas_dump.pyscript to buildbioschemas-biii-dump.ttlandbise-ontology-biii-dump.ttlfrom JSON/JSON-LD files in adata/directory. - Extended the BIII importer to parse
created/changedtimestamps from multiple representations via a sharedparse_datetime()helper. - Added
beautifulsoup4to the bioschemas generator requirements to support HTML sanitization in the imported BIII exporter code.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| bioschemas-gen/requirements.txt | Adds BeautifulSoup dependency needed by the BIII importer when used from bioschemas-gen. |
| bioschemas-gen/biii_bioschemas_dump.py | New script to generate the BIII RDF dump TTL artifacts from versioned metadata. |
| biii-import/biseEU_LD_export.py | Adds a timestamp parsing helper and uses it for dateCreated/dateModified. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+20
to
+26
| def parse_datetime(value): | ||
| if isinstance(value, (int, float)): | ||
| return datetime.datetime.fromtimestamp(value) | ||
| try: | ||
| return datetime.datetime.fromisoformat(value) | ||
| except ValueError: | ||
| return datetime.datetime.fromtimestamp(float(value)) |
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 PR creates a dedicated dump script to generate the BIII-related dataset dumps:
Instead of fetching live from BIII as current in the
contentrepo, this script is strictly aimed at the newmetadata-commonsrepo and creates pretty much identical files from the data that is versioned in the repo.This new dump script will then be called together with all dump scripts to generate the artifact that is then pushed onto GHCR.