Fixed a bug that caused plain literals in objects to not be converted to TURTLE.
--- a/playground/jsonld-turtle.js Wed Jan 18 11:28:48 2012 +0800
+++ b/playground/jsonld-turtle.js Wed Jan 18 15:03:49 2012 -0500
@@ -104,15 +104,21 @@
}
else if(obj instanceof Object)
{
- // the object is an IRI, typed literal or language-tagged literal
if("@value" in obj && "@type" in obj)
{
+ // object is a typed literal
rval = "\"" + obj["@value"] + "\"^^<" + obj["@type"] + ">";
}
else if("@value" in obj && "@language" in obj)
{
+ // object is a plain literal with a language
rval = "\"" + obj["@value"] + "\"@" + obj["@language"];
}
+ else if("@value" in obj)
+ {
+ // object is a plain literal
+ rval = "\"" + obj["@value"] + "\"";
+ }
else if("@id" in obj)
{
var iri = obj["@id"];