[JSON] The best of both worlds?

Thinking a bit more about how this object-based vs. triple-based
approach has turned into a divisive discussion (partly my fault, I'm
sure). There is another option - we support both approaches in a single
format by providing something in the default context to switch between
the two mechanisms, so object based would be this:

{
   "#": { "name": "http://xmlns.com/foaf/0.1/name" },
   "@": "http://example.com/people#david",
   "name": "David Wood@en"
}

and triple-based would be something like this:

{
   "#": "RDF-IN-JSON-RAW-TRIPLES",
   "@":
   [
      {
         "subject": "http://example.org/people#david"
         "predicate": "http://xmlns.com/foaf/0.1/name"
         "object":
         {
            "value": "David Wood"
            "language": "en"
         }
      },
      ...
   ]
}

The framing of these objects above is a bit ugly, but it's something
that I know would work in JSON-LD (just as a proof of concept).

Basically, the RDF in JSON processor would have two modes of operation,
the first is the object-based mechanism. The second is the triple-based
mechanism. The interesting thing with this approach is that you could
switch between the two fairly easily. The other way that we could do
this is by switching off of the top-level JSON object:

{ ... } -> object-based processing mode
[ ... ] -> triple-based processing mode

So, we may not have to pick - this approach could effectively combine
RDF/JSON / Flat Triples / JTriples with JSON-LD / JSN3 / RDFj.

We could call it: FlatJTriplesinJSONwithRDFandJSN3jGRDDLforLinkedData :P

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: Payment Standards and Competition
http://digitalbazaar.com/2011/02/28/payment-standards/

Received on Monday, 21 March 2011 02:25:32 UTC