Skip to content

Don't fetch a document's reference to the bblock's own JSON-LD context - #98

Merged
avillar merged 1 commit into
masterfrom
jsonld-own-context-ref
Oct 21, 2026
Merged

avillar merged 1 commit into
masterfrom
jsonld-own-context-ref

Conversation

@rob-metalinkage

Copy link
Copy Markdown
Collaborator

Problem

When a JSON document is uplifted, the validating bblock's own JSON-LD context is inlined from the local build, then the document's own @context entries are appended. If the document references the bblock's published context URL, which a transform output does when it refers to its target profile's context, that URL is fetched as well. The fetched version overrides the inlined one:

  • In CI, the previously published context is used instead of the one being built. For example, a term whose type changed in this build (phenomenonTime from @id to a literal) is uplifted with the old definition, so time strings become IRIs.
  • In a local build (e.g. --base-url http://localhost:...), the URL can't be reached and uplift fails.

Change

RdfValidator drops @context entries equal to the bblock's own context URL (jsonld_url), as long as the local context was loaded. Other context entries are kept as before.

Tests

tests/test_validate.py: a document that references the bblock's own context URL alongside a local context is uplifted with the inlined context, and the URL isn't fetched.

Found while validating SOSA spec-example transform outputs against their target profiles (opengeospatial/ogcapi-sosa).

🤖 Generated with Claude Code

When uplifting a JSON document whose @context references the validating
bblock's own published context URL (e.g. a transform output that refers to
its target profile's context), that context is already inlined from the
local build. Fetching the URL as well would load the previously published
version over it (or fail, for a local build), so drop that reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avillar
avillar merged commit 50a7123 into master Oct 21, 2026
1 check passed
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.

2 participants