Re: Comments on RDF graph canonicalization draft

On 03/08/2013 09:59 AM, David Booth wrote:
> Regarding
> http://json-ld.org/spec/latest/rdf-graph-normalization/
>
> I am delighted to see that people are working on this!  This will help 
> fill a huge gap that we currently have.  A few small suggestions:
>
> 1. You really should reference Jeremy Carroll's original work on RDF 
> canonicalization:
> http://www.hpl.hp.com/techreports/2003/HPL-2003-142.pdf
>
> 2. I do not find the word "canonical" or "canonicalization" anywhere 
> in the document, although it is clearly implied by the bnode prefix 
> "c14n".  It is a stylistic choice whether to call the process 
> "normalization" or "canonicalization".  In my observation, over the 
> years "canonicalization" has been used more specifically for this 
> process (as Jeremy Carroll's 2003 paper did), and hence would be the 
> better choice of primary term.  But regardless of the choice, I think 
> it is important to include both terms up front, to enable searchers to 
> find it more easily.

Thank you, these are good suggestions. Unfortunately, the document is 
very out of date; we've been pressed for time getting other spec work 
and Web Payment-related implementations finished.

>
> 3. The document contains an editorial note saying that the algorithm 
> is obsolete.  Could you please point to the newer one? Even if it is 
> not yet finalized, it would be nice to be able to see what it is, 
> whether it is just an email message, a snippet of code or whatever.  
> If you could point to pieces of working code -- even if they are not 
> finished -- that would be great too.

We have an RDF dataset normalization/canonicalization algorithm 
implemented that is used in PaySwarm (http://payswarm.com) for the Web 
Payments work. We haven't updated the spec's algorithm prose to reflect 
what has been successfully implemented in JavaScript, PHP, and Python 
(the python version is very slightly out of date at the moment, but will 
be updated soon). You can take a look at the source here:

PHP (synchronous implementation):
https://github.com/digitalbazaar/php-json-ld/blob/master/jsonld.php#L2256

JavaScript (asynchronous implementation):
https://github.com/digitalbazaar/jsonld.js/blob/master/js/jsonld.js#L1956

Python (dated)
https://github.com/digitalbazaar/pyld/blob/master/lib/pyld/jsonld.py#L1393

The implementations exist in these JSON-LD processors but operate on RDF 
datasets (they are there because PaySwarm uses JSON-LD and requires RDF 
dataset normalization). There are several normalization tests that are 
currently part of the JSON-LD test-suite here:

https://github.com/json-ld/json-ld.org/tree/master/test-suite/tests

The algorithm is put to use throughout the demo of PaySwarm here:

http://payswarm.com/wiki/WordPress_Recipes_Demo

The algorithm is used in the demo to normalize descriptions of assets 
that are being sold on the web, as well as the listings (offerings for 
sale) that contain pricing information for the assets, and contracts 
between buyers and sellers of those assets. Once these items are 
normalized, they are digitally signed by appropriate parties. Since 
these items live on the web, can be obtained in various representations 
(RDFa/JSON-LD), and are used in commerce, they must be able to be able 
to be easily compared and verified. The combination of the RDF dataset 
normalization algorithm and digital signatures makes this possible.

You can also play around with the results of RDF dataset normalization 
on the JSON-LD playground here:

http://json-ld.org/playground/

Just click the examples (or use your own JSON-LD) and then click on the 
"Normalized" tab.

Hope this helps!
-Dave

-- 
Dave Longley
CTO
Digital Bazaar, Inc.
http://digitalbazaar.com

Received on Friday, 8 March 2013 16:53:56 UTC