Skip to content

Example 9 has different results in the playground #525

Open
@wouterbeek

Description

@wouterbeek

Example 8 in the standard document looks very different in the JSON-LD Playground (accessed through the "Open in playground" button from the standard document). This is example 8:

{
  "@context": {"@vocab": "http://example.org/"},
  "location": {},
  "contains": {
    "creator": {},
    "contains": {
      "description": {}
    }
  }
}

In the standard, it looks as follows:

{
  "@context": {"@vocab": "http://example.org/"},
  "@id": "http://example.org/library",
  "@type": "Library",
  "location": "Athens",
  "contains": {
    "@id": "http://example.org/library/the-republic",
    "@type": "Book",
    "creator": "Plato",
    "title": "The Republic",
    "contains": {
      "@id": "http://example.org/library/the-republic#introduction",
      "@type": "Chapter",
      "description": "An introductory chapter on The Republic.",
      "title": "The Introduction"
    }
  }
}

But in JSON-LD Playground, it looks as follows:

{
  "@context": {
    "@vocab": "http://example.org/"
  },
  "@graph": [
    {
      "@id": "http://example.org/library",
      "@type": "Library",
      "contains": {
        "@id": "http://example.org/library/the-republic",
        "@type": "Book",
        "contains": {
          "@id": "http://example.org/library/the-republic#introduction",
          "@type": "Chapter",
          "description": "An introductory chapter on The Republic.",
          "title": "The Introduction"
        },
        "creator": "Plato",
        "title": "The Republic"
      },
      "location": "Athens"
    },
    {
      "@id": "http://example.org/library/the-republic",
      "@type": "Book",
      "contains": null,
      "creator": "Plato",
      "location": null,
      "title": "The Republic"
    }
  ]
}

^ Notice that the use of @graph and null, together with the repetition of the values "Book', "Plato", and "The Republic", makes this snippet uglier than the one in the standard document

This is the live link to the playground: link

Expected

The same example to look identical (or at least more similar) in the document and in the playground.

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