Update playground to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Tue, 22 Oct 2013 11:16:53 -0400
changeset 2043 ece719bdd4fb
parent 2042 70cb755f6630
child 2044 4e3b13ed6573
Update playground to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Tue Oct 22 11:16:25 2013 -0400
+++ b/playground/jsonld.js	Tue Oct 22 11:16:53 2013 -0400
@@ -393,6 +393,11 @@
     callback = options;
     options = {};
   }
+  else if(typeof ctx === 'function') {
+    callback = ctx;
+    ctx = null;
+    options = {};
+  }
   options = options || {};
 
   // set default options
@@ -3883,10 +3888,14 @@
         var items = reverseMap[reverseProperty];
         for(var ii = 0; ii < items.length; ++ii) {
           var item = items[ii];
+          var itemName = item['@id'];
+          if(_isBlankNode(item)) {
+            itemName = namer.getName(itemName);
+          }
+          _createNodeMap(item, graphs, graph, namer, itemName);
           jsonld.addValue(
-            item, reverseProperty, referencedNode,
+            subjects[itemName], reverseProperty, referencedNode,
             {propertyIsArray: true, allowDuplicate: false});
-          _createNodeMap(item, graphs, graph, namer);
         }
       }
       continue;