Skip to content

Error reported when setting "@language": null in a value object  #76

@jasnell

Description

@jasnell

According to http://www.w3.org/TR/json-ld/#string-internationalization, the following should be valid:

{
  "@context": ["http://asjsonld.mybluemix.net", {"@language": "en"}],
  "@id": "urn:example:1",
  "displayName": {
    "@value": "foo",
    "@language": null
  }
}

jsonld.js returns an error, however (as evidenced on the playground: http://tinyurl.com/o25sr3y)

{
   "name": "jsonld.CompactError", 
  "message": "Could not expand input before compaction.", 
  "details": { 
    "cause": { 
      "name": "jsonld.SyntaxError", 
      "message": "Invalid JSON-LD syntax; language map values must be strings.", 
      "details": { 
        "code": "invalid language map value",
        "languageMap": { "@value": "foo", "@language": null } 
      } 
    } 
  } 
}

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