Skip to content

Consider supporting more that "string" values in a Language Map. #725

Description

@BigBlueHat

Currently, the API specification says...

For each item in language value:
....
item must be a string, otherwise an invalid language map value error has been detected and processing is aborted.

Consequently, that means the following JSON-LD (that both I and AI thought was possible...) actually fails (generated by Google's current "AI Mode"):

{
  "@context": {
    "schema": "https://schema.org",
    "name": {
      "@id": "schema:name",
      "@container": "@language"
    }
  },
  "@id": "https://example.com",
  "@type": "schema:Product",
  "name": {
    "en": "W3C Headphones!",
    "ar": {
      "@value": "!W3C سماعات",
      "@direction": "rtl"
    }
  }
}

The above code in the JSON-LD Playground it fails with...

Invalid JSON-LD syntax; language map values must be strings.
...as it should, per the current spec.

I'd like to explore changing that text such that Language Maps can support the provision of @direction inline.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions