W3C home > Mailing lists > Public > public-rdf-wg@w3.org > March 2011

Re: [JSON] PROPOSAL: Syntax structure should be object-based

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Wed, 16 Mar 2011 10:57:42 -0400
Message-ID: <4D80CFE6.1020304@digitalbazaar.com>
To: RDF Working Group <public-rdf-wg@w3.org>
On 03/16/11 10:06, Andy Seaborne wrote:
> While I can support a data-object style (providing a document is
> self-contained and matters of coverage), the more important question to
> me is whether we are designing to API access or direct datastructure
> access, and within the latter whether there is translation between
> on-the-wire and applications forms.

We (our company) found that it is nearly impossible to generically
address these two approaches at the same time without an API:

1. Use JSON as-is but translate it to RDF.
2. Support terms, CURIEs, datatypes or languages.

I think we need a minimum API... and really, nobody uses eval() these
days - they use jQuery, which uses the JSON API -> JSON.parse()

However, my definition of API might be different from your definition of
API. I think we need a single API call:

rdfInJson.parse()

That's it.

We also want to have an RDF in JSON parser that can plug into the RDF
API, but that is an orthogonal issue. There is the concept of a
"Projection" in the RDFa API (which we lifted from SPARQL)... that's
what I think the rdfInJson.parse() method should return - a Projection.
The projection would allow people to do stuff like:

obj.name

instead of heavy-weight stuff like (in the RDF API):

var newGraph = oldGraph.filter(function f(triple)
{
   if(triple.property == "http://xmlns.com/0.1/foaf/name")
      return true;
   else
      return false;
}

We want the ability to create Projections in the RDF API, the RDFa API
and the RDF in JSON API. We want that interface to be the same, and
return the same values across all three APIs

> There is the API for RDF in RDFa.  How does fit in?  If not, aren't we
> getting close to two approaches to much the same thing?

We (the people editing the RDF/RDFa/JSON-LD API specs) are determined to
make the two approaches not only compatible, but the exact same. It may
not happen in the end, but we want to see it happen.

-- 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 Wednesday, 16 March 2011 14:58:52 UTC

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