Skip to content

Local context should be embedded during compaction #8

@fsteeg

Description

@fsteeg

Given doc.json:

{ "http://schema.org/url": "http://manu.sporny.org/" }

And context.json:

{ "@context": { "homepage": "http://schema.org/url" } }

Running jsonld compact -c context.json doc.json yields:

{
  "@context": "context.json",
  "homepage": "http://manu.sporny.org/"
}

The local file reference for @context makes this invalid JSON-LD:

jsonld compact -c context.json doc.json | jsonld format -q -

Error: {
  "name": "jsonld.InvalidUrl",
  "details": {
    "code": "loading remote context failed",
    "url": "/context.json",
    ...
  }
}

The local context should be embedded to get valid JSON-LD:

{
  "@context": { "homepage": "http://schema.org/url" },
  "homepage": "http://manu.sporny.org/"
}

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