[openbiblio-dev] JSON RDF serializations

Rufus Pollock rufus.pollock at okfn.org
Thu Apr 7 17:06:03 UTC 2011


Will pointed me to the the summary of RDF JSON serializations formats on:


Having reviewed these I think JSON-LD is the most attractive. It
combines precision with a reasonable terseness.

Our hand-rolled format is already very close to the JSON-LD format
(ours most closely resembles a cross of the linked data api and
JSON-LD). JSON-LD has the improvement of ours of greater explicitness
and detailed thought about additional features (lang, types) and edge

I recommend we adopt it asap.

Below I provide a fully worked through example of our data in JSON-LD.



## Minor tweaks to JSON-LD

There are couple of minor extra features I'd like to have in JSON-LD.

1. Use the 'hashmap' (which maps nicknames for namespaces to their
uris) to reference an external hashmap -- this way you can avoid
repetition and have a standard set of namespaces and reuse a the
mini-schema aspect of the hashmap. One could do this via e.g. a
special __include__ identifer:

    "#": {
      "__include__": "path-to-json-dictionary"

That said this could add a lot of complexity for relatively little
benefit (one can always do this kind of compression internally).

2. Ability to use 'namespaces' in the hashmap when defining mapping.
For example to be able to do::

    "#": {
      "title": "dc:title"

### Example Usage

For an Entry:

    // this is wrong in that i should expand namespaces but for terseness
    "Entry": "http://purl.org/ontology/bibo/Document",
    "title": "http://purl.org/dc/terms/title",
    "creators": "http://purl.org/dc/terms/contributor",
    "publishers": "http://purl.org/dc/terms/publisher",
    "subjects": "http://purl.org/dc/terms/subject",
  "@": "http://bibliographica.org/entry/my-id",
  "a": "Entry",
  "title": "My Title",
  "creators": [
      "@": <entity-1>
      "label": ...
      "title": ...
  // just to be different -- probably should be like creators
  "publishers": [ <entity-1>, <entity-2> ]
  "subjects": ...
  // ... more attributes ...

More information about the openbiblio-dev mailing list