Skip to content

Enhance ToxTemp export to support FAIR data principles#134

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/enhance-toxtemp-export
Draft

Enhance ToxTemp export to support FAIR data principles#134
Copilot wants to merge 3 commits intomainfrom
copilot/enhance-toxtemp-export

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

Exported ToxTemp drafts lack the structured metadata, persistent identifiers, open formats, and provenance information needed for downstream discovery and reuse. This adds foundational FAIR data support across all four principles.

Model

  • Added uid (UUIDField) to Assay as a stable persistent identifier (urn:uuid:<uid>), with migration 0027_assay_uid

New export types

Type MIME Description
jsonld application/ld+json JSON-LD with schema.org + Dublin Core context; Q&A embedded as PropertyValue items
zip application/zip FAIR bundle: <slug>.jsonld + PROVENANCE.json + LICENSE.txt + README.md

Both types are added to Config.EXPORT_MAPPING / Config.EXPORT_MIME_SUFFIX and excluded from PANDOC_EXPORT_TYPES (handled inline like json).

New API endpoint

GET /api/assay/<uuid>/metadata/ — returns the JSON-LD document for an assay; responds application/ld+json; requires authentication.

Export content improvements

  • generate_json_from_assay now includes identifier (UUID), author (name + ORCID when set), keywords, and license
  • generate_jsonld_from_assay — schema.org Dataset with @id, creator, hasPart (Q&A), license, provenance timestamps
  • generate_provenance_dict — W3C PROV-JSON-inspired record capturing agent, activity, software, and export timestamp
  • generate_fair_zip_bytes — in-memory ZIP with all FAIR artefacts

UI

Export dropdowns (overview table + answer page) now include a FAIR Exports section with JSON-LD and FAIR ZIP options.

# Programmatic access example
GET /api/assay/550e8400-e29b-41d4-a716-446655440000/metadata/
# → application/ld+json with @context, @type: Dataset, identifier, creator (+ ORCID), hasPart Q&A, license, prov timestamps

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • postgres_test_for_django
    • Triggering command: /home/REDACTED/.cache/pypoetry/virtualenvs/toxtempassistant-tf6wyKE3-py3.12/bin/pytest /home/REDACTED/.cache/pypoetry/virtualenvs/toxtempassistant-tf6wyKE3-py3.12/bin/pytest myocyte/toxtempass/tests/test_export_security.py myocyte/toxtempass/tests/test_export_errors.py -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits April 25, 2026 17:26
…ythonic line continuation in tests

Agent-Logs-Url: https://github.com/johannehouweling/ToxTempAssistant/sessions/86e45995-168e-42ac-96fe-e9bd184cb742

Co-authored-by: johannehouweling <95692173+johannehouweling@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance Toxtemp export to support FAIR data principles Enhance ToxTemp export to support FAIR data principles Apr 25, 2026
Copilot AI requested a review from johannehouweling April 25, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance Toxtemp Export to Support FAIR Data Principles

2 participants