Skip to content

Warn or error if non-keyword strings having "@" are encountered #16

Closed
@gkellogg

Description

@gkellogg

Looking at a schema.org example for ItemList, there is a JSON-LD example which includes the fictitious @url keyword, where they likely meant @id.

{
  "@context": "http://schema.org",
  "@type": "ItemList",
  "@url": "http://en.wikipedia.org/wiki/Billboard_200",
  "name": "Top music artists",
  "description": "The artists with the most cumulative weeks at number one according to Billboard 200",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "item": {
        "@type": "MusicGroup",
        "name": "Beatles"
      }
    },
    {
      "@type": "ListItem",
      "position": 2,
      "item": {
        "@type": "MusicGroup",
        "name": "Elvis Presley"
      }
    },
    {
      "@type": "ListItem",
      "position": 3,
      "item": {
        "@type": "MusicGroup",
        "name": "Michael Jackson"
      }
    },
    {
      "@type": "ListItem",
      "position": 3,
      "item": {
        "@type": "MusicGroup",
        "name": "Garth Brooks"
      }
    }
  ]
}

There's nothing to signal an issue, and a JSON-LD processor will happily resolve this relative to @vocab as http://schema.org/@url. This creates a potential forward-compatibility issue if new keywords are introduced, as they are in 1.1. We might want to describe normative or suggested behavior if a processor encounters a string which could hold a keyword, but holds something else starting with @.

cc/ @danbri

Original issue: Warn or error if non-keyword strings having "@" are encountered #598

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Errata

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions