jsonld.js icon indicating copy to clipboard operation
jsonld.js copied to clipboard

@base in remote context not ignored

Open balhoff opened this issue 8 years ago • 2 comments

For this document in the JSON-LD Playground:

{
  "@context": [
    "https://raw.githubusercontent.com/monarch-initiative/monarch-app/master/conf/monarch-context.jsonld",
    {
      "ex": "http://example.org/",
      "ex:friendOf": {
        "@type": "@id"
      },
      "ex:hasFriend": {
        "@type": "@id"
      }
    }
  ],
  "@id": "3456",
  "ex:name": "Jim",
  "ex:friendOf": "1234",
  "ex:hasFriend": "9876"
}

The value of @base found in the remote context is used to expand IRIs, like http://monarch-initiative.org/1234.

This seems to be disallowed by the spec: "Please note that the @base will be ignored if used in external contexts."

balhoff avatar May 24 '16 02:05 balhoff

I've observed this behavior as well. Is this a bug in the spec or a bug in this implementation of a JSON-LD processor? I like the behavior that @base in a remote context expands IRIs (because then my @context can be a simple string/URI), but I don't know what issues that causes for recursively specified contexts.

briancr-ms avatar Apr 23 '18 16:04 briancr-ms

@davidlehn -- can you look into this?

dlongley avatar May 26 '20 23:05 dlongley