Refactor JSON-LD to Schema-Driven Projection

Open
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start with app/services/jsonld.py and the project_to_jsonld function, then read ADR 0019 and ADR 0009 to understand the two-tier strategy and content negotiation requirements. Done means external Organizational JSON Schema definitions override internal SQLModel json_schema_extra annotations, and the semantic graph is built dynamically without hardcoded mapping logic.

Written by the indexing model from the issue text.

Description

metadata priority: medium technical-debt

Currently, app/services/jsonld.py hardcodes the mapping between internal Pydantic models and external semantic ontologies (DCAT, PROV-O) via procedural dictionaries. This creates a hidden third source-of-truth. This must be refactored into a Generic Projection Engine.

Acceptance Criteria:

  • Implement the Two-Tier Strategy: Parse an external Organizational JSON Schema if provided (Tier 1 override), or fallback to parsing the internal SQLModel's json_schema_extra annotations (Tier 2).
  • Update the project_to_jsonld function to construct the semantic graph dynamically based purely on those schema definitions, removing all hardcoded logic.

Governing ADR(s): ADR 0019, ADR 0009


Migrated from the internal tracker, where it was #6, opened 2026-02-25.

Dominant language
Python
Stars
0
Forks
1
Avg merge
26m
Merged PRs (30d)
24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ukaea/fds

All issues in ukaea/fds

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.