Update to latest jsonld.js.
--- a/playground/jsonld.js Thu Sep 19 16:42:02 2013 -0400
+++ b/playground/jsonld.js Thu Sep 19 16:42:31 2013 -0400
@@ -1209,7 +1209,7 @@
if(!(key1 in this.cache)) {
this.cache[key1] = {};
}
- this.cache[key1][key2] = result;
+ this.cache[key1][key2] = _clone(result);
};
/**
@@ -3464,12 +3464,14 @@
var rval = {'@value': o.value};
// add language
- if('language' in o) {
+ if(o['language']) {
rval['@language'] = o.language;
}
- // add datatype
else {
var type = o.datatype;
+ if(!type) {
+ type = XSD_STRING;
+ }
// use native types for certain xsd types
if(useNativeTypes) {
if(type === XSD_BOOLEAN) {