W3C home > Mailing lists > Public > public-linked-json@w3.org > September 2011

RE: Multiple contexts (ISSUE-32)

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Thu, 29 Sep 2011 11:01:05 +0200
To: <public-linked-json@w3.org>
Cc: "'Gregg Kellogg'" <gregg@kellogg-assoc.com>
Message-ID: <000001cc7e86$533dac90$f9b905b0$@lanthaler@gmx.net>
> Yes, each object can have it's own context.

OK.. We should mention this in the spec. I will prepare something.


> I also suggested using an
> array notation to allow a give object to have multiple contexts, which
> could allow a remote context and an in-line. For example, the in-line
> could be used to specify @language.

Right, you proposed the following form:

{
  "@context": [
    "/api/context.json",
    { "@language": "en" }
  ],
  "@subject": ...
}

I think that's quite a nice approach.. I see only one issue with it. People
could start doing something like:

{
  "@context": [
    "/api/context.json",
    { "xy": "..a..", "@language": "en" },
    { "xy": "..b..", "@language": "de" }
  ],
  "@subject": ...
}

As we generally say that arrays are unordered in JSON-LD we have no way to
resolve this conflict. Saying that in this case the order of the elements
matters wouldn't be a very elegant solution.

Thus, the approach suggested by Niklas:

{
  "@context": {
    "@import": "/api/context.json",
    "@language": "en",
    "@base": "http://example.org/"
  }
  "@subject": ...
}

or Ivan:

{
  "@importcontext": "http:...",
  "@context": {
    ...
  }
}

might be easier to understand.

We might even generalize Niklas' approach and say that @import can be used
to import both context and instance documents. Then we could have something
like


{
  "@import": "my-big-context.jsonld",
  "@context": { "@language": "en" },
  "name": "Markus Lanthaler",
  "knows": [
    { "name": Gregg Kellog", "@import": "/details/gregg.jsonld" }
  }
}

But this might go too far...



--
Markus Lanthaler
@markuslanthaler
Received on Thursday, 29 September 2011 09:01:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:32 UTC