Updated to latest version of jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Thu, 25 Aug 2011 20:14:11 -0400
changeset 185 2486995b62b4
parent 184 92d373fbc22f
child 186 8958cd459c94
Updated to latest version of jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Thu Aug 25 14:16:30 2011 -0400
+++ b/playground/jsonld.js	Thu Aug 25 20:14:11 2011 -0400
@@ -50,11 +50,9 @@
 
 var xsd =
 {
-   anyType: ns.xsd + 'anyType',
    boolean: ns.xsd + 'boolean',
    double: ns.xsd + 'double',
-   integer: ns.xsd + 'integer',
-   anyURI: ns.xsd + 'anyURI'
+   integer: ns.xsd + 'integer'
 };
 
 /**
@@ -744,7 +742,7 @@
             // datatype is IRI
             else if('@iri' in value)
             {
-               type = xsd.anyURI;
+               type = '@iri';
             }
             // can be coerced to any type
             else
@@ -837,7 +835,7 @@
       }
 
       // compact IRI
-      if(type === xsd.anyURI)
+      if(type === '@iri')
       {
          if(rval.constructor === Object)
          {
@@ -979,7 +977,7 @@
          rval = {};
          
          // expand IRI
-         if(coerce === xsd.anyURI)
+         if(coerce === '@iri')
          {
             rval['@iri'] = _expandTerm(ctx, value, null);
          }
@@ -1084,7 +1082,7 @@
    // built-in type coercion JSON-LD-isms
    if(p === '@subject' || p === ns.rdf + 'type')
    {
-      rval = xsd.anyURI;
+      rval = '@iri';
    }
    // check type coercion for property
    else if('@coerce' in ctx)
@@ -1108,13 +1106,6 @@
             if(props[i] === p)
             {
                rval = _expandTerm(ctx, type, usedCtx);
-               
-               // '@iri' is shortcut for xsd.anyURI
-               if(rval === '@iri')
-               {
-                  rval = xsd.anyURI;
-               }
-               
                if(usedCtx !== null)
                {
                   if(!('@coerce' in usedCtx))