Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 9 has different results in the playground #525

Open
wouterbeek opened this issue Jun 16, 2023 · 1 comment
Open

Example 9 has different results in the playground #525

wouterbeek opened this issue Jun 16, 2023 · 1 comment

Comments

@wouterbeek
Copy link

wouterbeek commented Jun 16, 2023

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.

@wouterbeek
Copy link
Author

A similar issue occurs for Example 14, this looks as follows in the JSON-LD Playground (again: uglier because of @graph and null):

{
  "@context": {
    "@version": 1.1,
    "@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": {
          "@language": "el-latn",
          "@value": "Plátōn"
        },
        "title": {
          "@language": "el-latn",
          "@value": "Res Publica"
        }
      },
      "location": {
        "@language": "el-latn",
        "@value": "Athína"
      }
    },
    {
      "@id": "http://example.org/library/the-republic",
      "@type": "Book",
      "contains": null,
      "creator": [
        {
          "@language": "el-latn",
          "@value": "Plátōn"
        },
        {
          "@language": "grc",
          "@value": "Πλάτων"
        },
        {
          "@language": "en",
          "@value": "Plato"
        }
      ],
      "location": null,
      "title": [
        {
          "@language": "grc",
          "@value": "Πολιτεία"
        },
        {
          "@language": "el-latn",
          "@value": "Res Publica"
        },
        {
          "@language": "en",
          "@value": "The Republic"
        }
      ]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant