Skip to content

Two example files are not valid JSON #247

Description

@jgeluk

Summary

Two files under examples/ are not valid JSON and therefore cannot be parsed by
any JSON or JSON-LD processor. Both are syntax errors, not modelling problems.

Nothing in the build parses the examples, so these have gone unnoticed.

1. examples/dprod-example.json:12 — missing comma

"outputPort": {
  "type": "DataService",
   "id": "https://www.ekgf.org/data/dataservice/permid-organization"
  "title": "Organization Endpoint",

The id member is not terminated with a comma before title.

json.decoder.JSONDecodeError: Expecting ',' delimiter: line 13 column 7

Fix: add the comma. (The stray leading space on that line is worth
normalising at the same time.)

2. examples/data-rights/example.jsonld:28 — trailing comma

  "action": "odrl:use",
}

JSON does not permit a trailing comma before a closing brace.

json.decoder.JSONDecodeError: Illegal trailing comma before end of object: line 28 column 27

Fix: remove the comma.

Verification

The other four parse cleanly:

file status
examples/dprod-example.json fails — line 13
examples/data-rights/example.jsonld fails — line 28
examples/data-quality/example.jsonld ok
examples/data-schema/example.jsonld ok
examples/equity-trade/example.jsonld ok
examples/sba-pool-rates/example.jsonld ok

Suggested follow-up

Add a build-time check that parses every examples/**/*.json and
examples/**/*.jsonld and fails the build on a syntax error. Without one this
recurs silently, since the spec generator only reads each example directory's
README.md and never touches the JSON payloads.

That check is also a prerequisite for the round-trip expansion test proposed in
#246 — the examples have to parse before they can be expanded against the
context.

Prior reports

Neither syntax error was reported directly, but the surrounding problem was, and
the validation that would have caught both was proposed nearly two years ago:

Provenance

Both errors were introduced by us, not inherited:

  • examples/dprod-example.json — the missing comma has been present since the
    file was added in a514e98 ("Add files via upload", 2025-02-07). It has never
    parsed. The unresolved <how do we search by entity type???> placeholder noted
    below arrived in the same commit.
  • examples/data-rights/example.jsonld — the trailing comma was introduced by
    31a05ee (2026-03-04), applying the Ballot 4: update data-rights example.jsonld (#83) #165 data-rights variant on ballot/4.

Both survived because nothing in the build parses the examples, which is the
substance of #92.

Notes

Two other things spotted in the same pass, neither a parse failure, so listed
here only for the record rather than as part of this issue:

  • examples/dprod-example.json:14 contains an unresolved authoring placeholder
    in a published example:
    "endpointURL": "https://api-eit.refinitiv.com/permid/search?q= <how do we search by entity type???>"
  • examples/data-rights/README.md:18 fences a mixed Turtle/JSON illustrative
    snippet as ```json. It reads as intentional pseudocode; only the fence
    language tag is inaccurate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions