w3c / w3c/json-ld-api

`expand-manifest.jsonld#tc037` mismatches the Playground

Open
#597 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
106
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Manifest

jq '.sequence[] | select(."@id" == "#tc037")' tests/expand-manifest.jsonld

which gives:

{
  "@id": "#tc037",
  "@type": [
    "jld:PositiveEvaluationTest",
    "jld:ExpandTest"
  ],
  "name": "property-scoped contexts which are alias of @nest",
  "purpose": "Nesting terms may have property-scoped contexts defined.",
  "input": "expand/c037-in.jsonld",
  "expect": "expand/c037-out.jsonld",
  "option": {
    "specVersion": "json-ld-1.1"
  }
}

Input

cat tests/$(jq -r '.sequence[] | select(."@id" == "#tc037") | .input' tests/expand-manifest.jsonld) | jq

that gives

{
  "@context": {
    "@version": 1.1,
    "@vocab": "http://example.org/",
    "nest": {
      "@id": "@nest",
      "@context": {
        "@vocab": "http://example.org/nest/"
      }
    }
  },
  "nest": {
    "property": "should be in /nest"
  }
}

Expected output

cat tests/$(jq -r '.sequence[] | select(."@id" == "#tc037") | .expect' tests/expand-manifest.jsonld) | jq

which gives

[
  {
    "http://example.org/nest/property": [
      {
        "@value": "should be in /nest"
      }
    ]
  }
]

What about the JSON-LD Playground?

[
  {
    "http://example.org/property": [
      {
        "@value": "should be in /nest"
      }
    ]
  }
]

Difference

+    "http://example.org/nest/property": [
-    "http://example.org/property": [

Question

My understanding of @nest logic is insufficient to judge who's right here. Any thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/expand-manifest.jsonld and the referenced expand/c037-in.jsonld and expand/c037-out.jsonld, then reproduce the result with the shown jq commands and compare it with the JSON-LD Playground output. Read the JSON-LD 1.1 @nest and property-scoped context rules to determine which result is correct; done means the discrepancy has an agreed resolution and the affected test or Playground behavior is identified for correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
backend-api-design, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.