Skip to content

JSON or YAML - which notation should I use for OO-LD? #96

Description

@simontaurus

Community question (seed for a docs FAQ entry).

Q: Should OO-LD documents be written in JSON or YAML? Is YAML supported?

Working answer (to be finalized in the spec's Notation section):

  • JSON is the normative, canonical serialization. OO-LD is JSON Schema + JSON-LD, both defined over the JSON data model. JSON has one unambiguous grammar, is safe to parse off the web, aligns with the JSON-native tooling (application/ld+json, validators, $ref/context processing), and has a canonicalization scheme (JCS, RFC 8785) for hashing/versioning.
  • YAML is allowed as an equivalent alternate serialization, restricted to the JSON-compatible YAML 1.2 subset (no tags, anchors/aliases, merge keys, or implicit typing beyond JSON; single document) - the same profile as YAML-LD. Within that subset YAML round-trips 1:1 with JSON.
  • Caveats for YAML authors: implicit typing differs across parsers (the "Norway problem": NO->false, 1.10->1.1) and comments do not survive conversion to the canonical JSON. Use the safe subset and treat JSON as the source of truth.
  • Tooling: examples in the spec and docs will render with a JSON main view and a "View as YAML" tab; the playgrounds are YAML-first for convenience.

Raised alongside #94 (getting-involved). Answers here will populate the docs FAQ.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionCommunity question: usage, tooling, or spec interpretation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions