Skip to content

fix(prefill): resolve prefixed and bare local-name keys in JSON-LD#1

Merged
jdsika merged 1 commit into
mainfrom
fix/wizard-prefill-matching
May 12, 2026
Merged

fix(prefill): resolve prefixed and bare local-name keys in JSON-LD#1
jdsika merged 1 commit into
mainfrom
fix/wizard-prefill-matching

Conversation

@jdsika
Copy link
Copy Markdown
Contributor

@jdsika jdsika commented May 12, 2026

Summary

The prefill matcher only compared JSON-LD keys against full SHACL URIs. Pipeline-generated JSON-LD uses prefixed keys (scenario:weatherSummary) and bare local names (weatherSummary), causing all pre-selected values to be missing in the wizard UI.

Changes

prefill.ts — Three-tier key resolution:

  1. Full URI match (existing)
  2. Prefix expansion using @context prefixes
  3. Bare local name via reverse lookup index

Also handles array values (e.g. criticalityFactors: ["high_relative_speed"]) by joining with ", ".

shape-to-fields.ts — Added hasVisibleFields() recursive check that filters out wizard steps where all fields resolve to empty groups (e.g. ScenarioManifestConstraints which is a validation-only sh:node constraint).

Tests

  • 4 new unit tests (prefixed keys, bare names, nested pipeline format, arrays)
  • All 46 API tests pass

The prefill matcher only compared JSON-LD keys against full SHACL URIs.
Pipeline-generated JSON-LD uses prefixed keys (scenario:weatherSummary)
and bare local names (weatherSummary), causing all pre-selected values
to be missing in the wizard UI.

Add three-tier key resolution: full URI, prefix expansion, and local
name matching. Also handle array values (join with comma) and filter
out wizard steps with no visible fields (validation-only sh:node
constraints like ScenarioManifestConstraints).

Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
@jdsika jdsika self-assigned this May 12, 2026
@jdsika jdsika added bug Something isn't working enhancement New feature or request labels May 12, 2026
@jdsika jdsika merged commit 588cb82 into main May 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant