W3C home > Mailing lists > Public > public-linked-json@w3.org > May 2016

use of @base

From: Jim Balhoff <balhoff@gmail.com>
Date: Mon, 16 May 2016 10:57:58 -0400
Message-Id: <575C5CE0-B8EC-4C9B-869F-1E6445D99E2E@gmail.com>
To: public-linked-json@w3.org

I am trying to understand how @base works. I’m running into a possible discrepancy between the JSON-LD playground and Java API and the documentation. I would like to use relative IRIs within my document, and specify the base IRI within the document for resolving these. I also have a remote context I would like to reference. This is working in the JSON-LD playground in this example:


When I have @base in the embedded context, it is used for interpreting the relative IRIs. (“1234” is expanded to "http://example.org/person/1234”). If I remove @base from the embedded context, the @base in the remote context is used.

However, I found that when using the jsonld-java API, any @base is ignored whenever I include any remote context. I assumed this was a bug at first, but the docs seem to suggest this is intended:

"Please note that the @base will be ignored if used in external contexts."

And an older version of that document says: "JSON-LD has no equivalent for the Turtle @base declaration”

Is the JSON-LD playground behavior in error?

Thank you,
Jim Balhoff
Received on Monday, 16 May 2016 14:58:29 UTC

This archive was generated by hypermail 2.3.1 : Monday, 16 May 2016 14:58:29 UTC