Skip to content

YAML-LD UCRs #2

@VladimirAlexiev

Description

@VladimirAlexiev

Related to w3c/json-ld-syntax#389, #3.
TODO: scan these issues to extract more requirements.

Like any great W3C work, we should start with a Use Case Requirements specification / collection.

Until we have a repo (@gkellogg) where we can collect UCR per issue, let's use the following format. It could help UCR editors collect the issues:

  • PRIO: Title (@ contacts)
    • description
    • considerations
    • considerations

Notes:

  • The checkbox shows which UCRs have been posted as distinct issues in this repo
  • PRIO is MUST/COULD/SHOULD and is approximate and subjective, so let's not spend too much effort discussing them. This is specifically not a "requirement compliance" rating
  • Can include contacts of people who suggested the idea, or could be interested to develop it further. Not intended to track authorship precisely
  • Give a detailed description
  • Give as many relevant considerations, examples and links as you can

Here we go


  • MUST: Least Surprise (@pchampin)

    • YAML-LD should work the same as JSON-LD unless specific processor options are selected
    • Since YAML is an extension of JSON, YAML-LD->RDF should produce the same as YAML->JSON-LD -> RDF,
    • YAML-LD should cover all features of JSON-LD 1.1
  • MUST: Human Readability (@anatoly-scherbakov)

  • MUST: Compatibility (@gkellogg)

    • YAML-LD must be compatible with other related syntaxes (see "Polyglot Modeling")
    • Eg using the $ sigil ("namespace") will overlap with other existing uses. For example, JSON Schema has $schema, $vocabulary and other other keywords that would not overlap with the JSON-LD keyword namespace (that uses the @ sigil)
  • SHOULD: YAML Intro (@VladimirAlexiev)

    • The YAML-LD spec or UCR spec should provide an introduction to YAML, since the YAML spec is rather technical
    • In particular, it should cover YAML extensions compared to JSON
  • SHOULD: Archetypical Examples (@VladimirAlexiev)

    • The UCR spec should include archetypical YAML examples from various domains, eg software projects, modules, issues, etc
  • SHOULD: Shortcuts (@VladimirAlexiev)

  • COULD: Versions (@VladimirAlexiev)

  • SHOULD: Extensions (@VladimirAlexiev)

    • Leverage YAML features over JSON. Quoting from the YAML spec "The YAML 1.0 specification was published in early 2004
      The YAML 1.1 specification was published in 2005. Around this time, the developers became aware of JSON. By sheer coincidence, JSON was almost a complete subset of YAML (both syntactically and semantically). The YAML 1.2 specification was published in 2009. Its primary focus was making YAML a strict superset of JSON".
    • Some of them can be quite useful in an RDF context:
    • Anchors and Aliases can represent non-tree graph structures and should mesh with JSON-LD Frames
  • Tags are comparable to datatypes YAML-LD datatypes (and tags for datatypes) #17.

    • the YAML json schema and core schema handle string, boolean, integer, float (the latter allows things like -.inf and .nan).
    • https://yaml.org/type/ handles a wider set, in particular dates and datetimes. But please note these are considered deprecated in 1.2 and are being removed in 1.3 Remove timestamp examples from the 1.2 spec yaml/yaml-spec#268 (comment)
    • Maybe we should define a YAML schema to handle more xsd datatypes?
    • It should aim to eliminate problems related to the limited and non-standardized set of JSON literals. Eg the JSON number 12345678901234567890.12345 is converted to RDF literal "12345678901234567168"^^xsd:integer (see jsonld playground)
    • And could even work as a replacement of @type, eg
# short form using tags
dc:date: !xsd!date 2022-05-18

# instead of long form
dc:date:
  @type: xsd:date
  @value: 2022-05-18

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