Skip to content

feat: generate biii dumps from versioned metadata - #55

Open
mihai-sysbio wants to merge 3 commits into
mainfrom
feat/biii-dump-from-repo
Open

feat: generate biii dumps from versioned metadata#55
mihai-sysbio wants to merge 3 commits into
mainfrom
feat/biii-dump-from-repo

Conversation

@mihai-sysbio

Copy link
Copy Markdown
Contributor

This PR creates a dedicated dump script to generate the BIII-related dataset dumps:

  • bioschemas-biii-dump.ttl
  • bise-ontology-biii-dump.ttl

Instead of fetching live from BIII as current in the content repo, this script is strictly aimed at the new metadata-commons repo 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py script to build bioschemas-biii-dump.ttl and bise-ontology-biii-dump.ttl from JSON/JSON-LD files in a data/ directory.
  • Extended the BIII importer to parse created/changed timestamps from multiple representations via a shared parse_datetime() helper.
  • Added beautifulsoup4 to 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))
Comment thread bioschemas-gen/biii_bioschemas_dump.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants