W3C home > Mailing lists > Public > public-rdf-wg@w3.org > October 2012

JSON-LD Data model / RDF Data Model differences

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Tue, 30 Oct 2012 14:03:35 -0400
Message-ID: <50901677.1000403@digitalbazaar.com>
To: RDF WG <public-rdf-wg@w3.org>
We had a small side-discussion at the F2F meeting today about
differences between lists in the JSON-LD data model and lists in the RDF
data model. This devolved/evolved into a re-hash of the JSON-LD data
model vs. the RDF data model discussion:


I was going to start by ranting about RDF lists, but it seems I already
did that back in May:

"I really hate RDF Lists"

Not having Graph/Dataset Literal as a primitive in RDF is also harming
the RDF data model. We should be able to place a graph/dataset literal
in the object position of an RDF triple. I don't expect that this group
will be able to resolve either issue, but I just thought I'd throw this
out there so that some of you might understand what is lacking in the
RDF data model.

Resolving these two issues above would help align the JSON-LD data model
with the RDF data model, specifically:

1. "Graph names can be blank nodes." The question of whether or not
   graph names can be blank nodes would have to be answered. I'd argue
   that you should be able to name graphs using blank nodes.
2. "Lists are part of the data model." Lists are part of the data model
   would be true for both models.
3. "Graphs/datasets are 'allowed' in the object position." Graphs would
   be "allowed" in the object position in both models.

We have simple answers to some of the other differences that would align
the two data models.

1. "Unconnected nodes (IRIs, blank nodes or values) are supported." We
   should add: "Authors SHOULD NOT use unconnected nodes (a node
   definition that does not contain any properties) in JSON-LD
2. "Edge labels may be blank nodes." We should add: "Authors SHOULD
   NOT use blank nodes as edge labels."
3. "Language tags are not normalized to lower case." We should add:
   "JSON-LD processors MUST normalize all language tags to lowercase
   when processing documents via the JSON-LD Algorithms."
4. "Scope of blank node labels". We should add: "Blank node labels are
   scoped to the JSON-LD document."

Which leaves these two differences between the JSON-LD data model and
the RDF data model:

1. "Supports 'plain' strings, numbers and booleans, separately from
   typed literals." This is true for TURTLE as well, so if there is a
   problem with JSON-LD, then there is a problem with TURTLE when it
   comes to this issue.
2. "Language maps are part of the data model." This is syntactic sugar
   that was a requested "deal breaker" feature by the Drupal community.
   If we don't include it, Drupal will willfully violate the JSON-LD
   spec (or come up with their own solution). Digital Bazaar's
   implementations will support Drupal by adding the feature to the
   implementation, thus willfully violating the JSON-LD spec. The
   difference in the data model does not result in any loss of
   information when converting to RDF, other than the ability to
   re-create the exact JSON-LD language-map structure when converting
   back to JSON-LD from RDF. I personally don't think people will
   care about not being able to round-trip language-maps from
   JSON-LD to RDF and back to JSON-LD, but if they do, Gregg Kellogg
   has proposed a mechanism that allows that to happen.

Hope that is a helpful rundown of the differences between the two data
models and my personal opinion of where we should be headed wrt. data
model alignment.

-- manu

Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: HTML5 and RDFa 1.1
Received on Tuesday, 30 October 2012 18:04:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:04:22 UTC