W3C home > Mailing lists > Public > public-linked-json@w3.org > June 2014

Mapping predefined values to URIs when interpreting JSON as JSON-LD

From: john.walker <john.walker@semaku.com>
Date: Tue, 3 Jun 2014 21:53:08 +0200 (CEST)
To: public-linked-json@w3.org
Message-ID: <1392671573.47119.1401825189000.open-xchange@oxweb02.eigbox.net>
I'm looking for some help/guidance with context usage.
 
Say I have an existing JSON document:
 
{
  "property1": "value1",
  "property2": "value2"
}
 
I'm struggling with mapping this to existing URIs.
Say:
property1 => http://example.com/vocab#foo
property2 => http://example.com/vocab#bar
value1 => http://example.com/vocab#baz
value2 => http://example.com/vocab#qux

So the triples I'm looking to derive are:

_:b0 <http://example.com/vocab#bar> <http://example.com/vocab#baz> .
_:b0 <http://example.com/vocab#foo> <http://example.com/vocab#qux> .

I tried with this context:

{
  "@context": {
    "property1": {
      "@id": "http://example.com/vocab#foo",
      "@type": "@id"
    },
    "property2": {
      "@id": "http://example.com/vocab#bar",
      "@type": "@id"
    },
    "value1": "http://example.com/vocab#baz",
    "value2": "http://example.com/vocab#qux"
  }
}

But this does not do the desired mappings for the values, instead the values are
just interpreted relative to the base/current URI.

It feels like I'm missing something obvious...

Cheers,
John

 
Received on Tuesday, 3 June 2014 19:53:31 UTC

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