Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 30 Apr 2012 21:21:39 -0400
changeset 605 270e795494f9
parent 603 9076a74cac17
child 606 d02c8fb8e183
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Mon Apr 30 19:54:24 2012 -0400
+++ b/playground/jsonld.js	Mon Apr 30 21:21:39 2012 -0400
@@ -1544,7 +1544,7 @@
  * @param callback(err, output) called once the operation completes.
  */
 Processor.prototype.fromRDF = function(statements, options, callback) {
-  // prepare graph map (maps graph name => subjects, lists, etc)
+  // prepare graph map (maps graph name => subjects, lists)
   var defaultGraph = {subjects: {}, listMap: {}};
   var graphs = {'': defaultGraph};
 
@@ -1597,28 +1597,25 @@
       continue;
     }
 
-    // prepare to assign next JSON-LD value
-    var value;
-
     // if graph is not the default graph
     if(name !== '') {
       // add graph subject to default graph as needed
       if(!(name in defaultGraph.subjects)) {
-        value = defaultGraph.subjects[name] = {'@id': name};
+        defaultGraph.subjects[name] = {'@id': name};
       }
       else {
-        value = defaultGraph.subjects[name];
+        defaultGraph.subjects[name];
       }
     }
 
     // add subject to graph as needed
     var subjects = graph.subjects;
     if(!(s in subjects)) {
-      value = subjects[s] = {'@id': s};
+      var value = subjects[s] = {'@id': s};
     }
     // use existing subject value
     else {
-      value = subjects[s];
+      var value = subjects[s];
     }
 
     // convert to @type unless options indicate to treat rdf:type as property