Re: Comments on RDF graph canonicalization draft

On 03/08/2013 09:59 AM, David Booth wrote:
> Regarding
> 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:
> 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 ( 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):

JavaScript (asynchronous implementation):

Python (dated)

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:

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

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:

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

Hope this helps!

Dave Longley
Digital Bazaar, Inc.

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