Re: About @type, @ and other tokens

On Mon, Jul 11, 2011 at 3:14 AM, Gregg Kellogg <gregg@kellogg-assoc.com> wrote:
> {
>   "@context": {
>     "uri": "@subject",
>     "a": "@type"
>   },
>   "uri": "http://subject/",
>   "a": "http://schema.org/Person"
> }
>
> Basically, the @context processing would establish mappings for "uri" =>
> "@subject", and "a" => "@type", and in the processing loop, then the key
> would be interpreted through this mapping and resolve to "@subject" and
> "@type" respectively.

Yes! That is very useful. This makes it possible to map many kinds of
JSON to RDF, as long as they adhere to a compatible basic shape. Also,
with coercing, type can be given as a term ({"a": "Person"}).

(Note though that there are a bunch of details and edge cases to
consider; as e.g. JSON "in the wild" quite often link to other *JSON*
representations, distinct from the canonical URIs of the resources
(see e.g. the LCSH data [1]).)

This is just what I'm after in Gluon (which the early "Compact Gluon"
[2] exihibits). One goal is to have the JSON look just like regular
JSON. The only "special" key would be the one providing a profile
(context) reference -- unless that is given out of band (e.g. in the
content type or a http link header). I'd recommend to publish JSON
with a context link inline, so one can discover it's detailed meaning
when needed.

I think it is possible to avoid the use of "@" entirely in such usage,
since it would be predefined which keys are "special" and which are
"triple terms".

A related idea is if it'd be useful to (configurably) be able to give
the subject @uri as the key of an object map (again, compact gluon use
that notation). Like:

  {
    "htttp://example.org/doc/1": { "title": "document one" }
  }

Here there's even a possibility of making JSON-LD a *superset* of
RDF/JSON. (While I'm inclined to believe that that syntax and a
compact "natural" JSON are *complementary*, it may be worth
considering depending on use case).

Best regards,
Niklas

[1]: http://id.loc.gov/authorities/sh95000541.json
[2]: http://code.google.com/p/oort/wiki/Gluon#Overview

Received on Monday, 11 July 2011 18:30:03 UTC