Use latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Thu, 12 Jan 2012 13:31:11 -0500
changeset 338 f206ab6e2a0d
parent 337 d2830bafe684
child 339 d44108365f01
child 340 1d685d4da5a6
Use latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Wed Jan 11 22:13:11 2012 -0500
+++ b/playground/jsonld.js	Thu Jan 12 13:31:11 2012 -0500
@@ -242,10 +242,18 @@
       }
    }
    
-   // term not found, if term is @type, use keyword
-   if(rval === null && iri === '@type')
+   // term not found, if term is keyword, use alias
+   if(rval === null)
    {
-      rval = _getKeywords(ctx)['@type'];
+      var keywords = _getKeywords(ctx);
+      if(iri in keywords)
+      {
+         rval = keywords[iri];
+         if(rval !== iri && usedCtx !== null)
+         {
+            usedCtx[rval] = iri;
+         }
+      }
    }
    
    // term not found, check the context for a prefix