Merge branch 'master' of github.com:json-ld/json-ld.org
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 01 May 2012 21:42:49 +0800
changeset 610 494be71d06d2
parent 609 10f3c55fb964 (current diff)
parent 607 d55646dd59f1 (diff)
child 611 f5082cc1e77e
Merge branch 'master' of github.com:json-ld/json-ld.org
spec/latest/json-ld-api/index.html
test-suite/tests/fromRdf-0001.jsonld
test-suite/tests/fromRdf-0001.nq
test-suite/tests/fromRdf-0002.jsonld
test-suite/tests/fromRdf-0002.nq
test-suite/tests/fromRdf-0003.jsonld
test-suite/tests/fromRdf-0003.nq
test-suite/tests/fromRdf-0004.jsonld
test-suite/tests/fromRdf-0004.nq
test-suite/tests/fromRdf-0005.jsonld
test-suite/tests/fromRdf-0005.nq
test-suite/tests/fromRdf-0006.jsonld
test-suite/tests/fromRdf-0006.nq
test-suite/tests/fromRdf-0007.jsonld
test-suite/tests/fromRdf-0007.nq
test-suite/tests/rdf-0001.jsonld
test-suite/tests/rdf-0001.sparql
test-suite/tests/rdf-0002.jsonld
test-suite/tests/rdf-0002.sparql
test-suite/tests/rdf-0003.jsonld
test-suite/tests/rdf-0003.sparql
test-suite/tests/rdf-0004.jsonld
test-suite/tests/rdf-0004.sparql
test-suite/tests/rdf-0005.jsonld
test-suite/tests/rdf-0005.sparql
test-suite/tests/rdf-0006.jsonld
test-suite/tests/rdf-0006.sparql
test-suite/tests/rdf-0007.jsonld
test-suite/tests/rdf-0007.sparql
test-suite/tests/rdf-0008.jsonld
test-suite/tests/rdf-0008.sparql
test-suite/tests/rdf-0009.jsonld
test-suite/tests/rdf-0009.sparql
test-suite/tests/rdf-0010.jsonld
test-suite/tests/rdf-0010.sparql
test-suite/tests/rdf-0011.jsonld
test-suite/tests/rdf-0011.sparql
test-suite/tests/rdf-0012.jsonld
test-suite/tests/rdf-0012.sparql
test-suite/tests/rdf-0013.jsonld
test-suite/tests/rdf-0013.sparql
test-suite/tests/rdf-0014.jsonld
test-suite/tests/rdf-0014.sparql
test-suite/tests/rdf-0015.jsonld
test-suite/tests/rdf-0015.sparql
test-suite/tests/rdf-0016.jsonld
test-suite/tests/rdf-0016.sparql
test-suite/tests/rdf-0017.jsonld
test-suite/tests/rdf-0017.sparql
test-suite/tests/rdf-0018.jsonld
test-suite/tests/rdf-0018.sparql
test-suite/tests/rdf-0019.jsonld
test-suite/tests/rdf-0019.sparql
test-suite/tests/rdf-0020.jsonld
test-suite/tests/rdf-0020.sparql
test-suite/tests/rdf-0021.jsonld
test-suite/tests/rdf-0021.sparql
test-suite/tests/rdf-0022.jsonld
test-suite/tests/rdf-0022.sparql
test-suite/tests/rdf-0023.jsonld
test-suite/tests/rdf-0023.sparql
test-suite/tests/rdf-0024.jsonld
test-suite/tests/rdf-0024.sparql
test-suite/tests/rdf-0025.jsonld
test-suite/tests/rdf-0025.sparql
test-suite/tests/rdf-0026.jsonld
test-suite/tests/rdf-0026.sparql
test-suite/tests/rdf-0027.jsonld
test-suite/tests/rdf-0027.sparql
test-suite/tests/rdf-0028.jsonld
test-suite/tests/rdf-0028.sparql
test-suite/tests/rdf-0029.jsonld
test-suite/tests/rdf-0029.sparql
test-suite/tests/rdf-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lang-nquads.js	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,82 @@
+/**
+ * @fileoverview
+ * Registers a language handler for prettify.js for N-Quads.
+ *
+ * @author David I. Lehn <[email protected]>
+ * @author Manu Sporny <[email protected]>
+ * @author Dave Longley <[email protected]>
+ */
+// FIXME: copied from turtle, needs simplification and clean up
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [], [
+      [PR.PR_ATTRIB_NAME + " nquads-curie", /^.*/]
+    ]), ['nquads-property']);
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [], [
+      [PR.PR_TAG + " nquads-uri", /^.*/]
+    ]), ['nquads-uri']);
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [], [
+      [PR.PR_TAG + " nquads-curie", /^.*/]
+    ]), ['nquads-curie']);
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [], [
+      [PR.PR_STRING, /^.*/]
+    ]), ['nquads-string']);
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [], [
+      [PR.PR_LITERAL, /^.*/]
+    ]), ['nquads-typed-literal-value']);
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [], [
+      [PR.PR_TYPE + " nquads-curie", /^.*/]
+    ]), ['nquads-typed-literal-type']);
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [], [
+      // FIXME: use RE that excludes ^^ from the value
+      ["lang-nquads-typed-literal-value", /^(.*\^\^)/],
+      ["lang-nquads-typed-literal-type", /^(.*)/],
+    ]), ['nquads-typed-literal']);
+PR.registerLangHandler(
+  PR.createSimpleLexer(
+    [
+      //[PR.PR_PUNCTUATION, /^[:|>?]+/, null, ':|>?'],
+      //[PR.PR_PLAIN, /^\s+/, null, ' \t\r\n']
+    ],
+    [
+      // empty string
+      // other properties
+      ["lang-nquads-property", /^"(.*)"\^\^/],
+      //[PR.PR_LITERAL, /^""/],
+      ["lang-nquads-string", /^"([^"]*)"/],
+      // "<...>"
+      ["lang-nquads-uri", /^<([^:]+:[^>]*)>[ \t]*/],
+      ["lang-nquads-uri", /^<([^:]+:[^>]*)>\./],
+      // typed literals
+      ["lang-nquads-typed-literal", /^"([^^"]+\^\^[^"]+)"/],
+      // "foo:bar"
+      ["lang-nquads-curie", /^(_:[^ ]*)/],
+      // literal strings
+      ["lang-nquads-string", /^""/],
+      // constants and native types
+      [PR.PR_LITERAL, /^(?:true|false|null|undefined)/],
+      [PR.PR_LITERAL,
+       new RegExp(
+           '^(?:'
+           // A hex number
+           + '0x[a-f0-9]+'
+           // or an octal or decimal number,
+           + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
+           // possibly in scientific notation
+           + '(?:e[+\\-]?\\d+)?'
+           + ')', 'i'),
+       null, '0123456789'],
+      [PR.PR_PLAIN, /^\w+/]
+    ]), ['nquads']);
--- a/playground/index.html	Mon Apr 30 16:05:56 2012 +0400
+++ b/playground/index.html	Tue May 01 21:42:49 2012 +0800
@@ -16,9 +16,8 @@
       <script type="text/javascript" src="js_beautify.js"></script>
       <script type="text/javascript" src="../common/prettify.js"></script>
       <script type="text/javascript" src="../common/lang-jsonld.js"></script>
-      <script type="text/javascript" src="../common/lang-turtle.js"></script>
+      <script type="text/javascript" src="../common/lang-nquads.js"></script>
       <script type="text/javascript" src="jsonld.js"></script>
-      <script type="text/javascript" src="jsonld-turtle.js"></script>
       <script type="text/javascript" src="playground.js"></script>
       <script type="text/javascript" src="playground-examples.js"></script>
    </head>
@@ -86,14 +85,14 @@
                        href="#normalized"><span>Normalized</span></a></li>
                     <li><a id="tab-framed" 
                        href="#framed"><span>Framed</span></a></li>
-                    <li><a id="tab-turtle" 
-                       href="#turtle"><span>TURTLE</span></a></li>
+                    <li><a id="tab-nquads" 
+                       href="#nquads"><span>N-Quads</span></a></li>
                 </ul>
                 <pre id="compacted" class="prettyprint lang-jsonld"></pre>
                 <pre id="expanded" class="prettyprint lang-jsonld"></pre>
                 <pre id="normalized" class="prettyprint lang-jsonld"></pre>
                 <pre id="framed" class="prettyprint lang-jsonld"></pre>
-                <pre id="turtle" class="prettyprint lang-turtle"></pre>
+                <pre id="nquads" class="prettyprint lang-nquads"></pre>
             </div>
 
          </div>
--- a/playground/jsonld.js	Mon Apr 30 16:05:56 2012 +0400
+++ b/playground/jsonld.js	Tue May 01 21:42:49 2012 +0800
@@ -379,7 +379,7 @@
  *          to convert.
  * @param [options] the options to use:
  *          [format] the format if input is a string:
- *            'text/x-nquads' for N-Quads (default).
+ *            'application/nquads' for N-Quads (default).
  *          [notType] true to use rdf:type, false to use @type (default).
  * @param callback(err, output) called once the operation completes.
  */
@@ -396,7 +396,7 @@
 
   // set default options
   if(!('format' in options)) {
-    options.format = 'text/x-nquads';
+    options.format = 'application/nquads';
   }
   if(!('notType' in options)) {
     options.notType = false;
@@ -404,7 +404,7 @@
 
   if(_isString(statements)) {
     // supported formats
-    if(options.format === 'text/x-nquads') {
+    if(options.format === 'application/nquads') {
       statements = _parseNQuads(statements);
     }
     else {
@@ -423,6 +423,9 @@
  *
  * @param input the JSON-LD input.
  * @param [options] the options to use:
+ *          [base] the base IRI to use.
+ *          [format] the format to use to output a string:
+ *            'application/nquads' for N-Quads (default).
  *          [resolver(url, callback(err, jsonCtx))] the URL resolver to use.
  * @param callback(err, statement) called when a statement is output, with the
  *          last statement as null.
@@ -436,7 +439,7 @@
     options = arguments[1] || {};
     callbackArg += 1;
   }
-  callback = arguments[callbackArg];
+  var cb = callback = arguments[callbackArg];
 
   // set default options
   if(!('base' in options)) {
@@ -446,6 +449,26 @@
     options.resolver = jsonld.urlResolver;
   }
 
+  if('format' in options) {
+    // supported formats
+    if(options.format === 'application/nquads') {
+      cb = function(err, statement) {
+        if(err) {
+          return callback(err);
+        }
+        if(statement !== null) {
+          statement = _toNQuad(statement);
+        }
+        callback(null, statement);
+      };
+    }
+    else {
+      throw new JsonLdError(
+        'Unknown output format.',
+        'jsonld.UnknownFormat', {format: options.format});
+    }
+  }
+
   // expand input
   jsonld.expand(input, options, function(err, expanded) {
     if(err) {
@@ -454,9 +477,15 @@
         'jsonld.RdfError', {cause: err}));
     }
 
-    // output RDF statements
-    var namer = new UniqueNamer('_:t');
-    new Processor().toRDF(expanded, namer, null, null, null, callback);
+    try {
+      // output RDF statements
+      var namer = new UniqueNamer('_:t');
+      new Processor().toRDF(expanded, namer, null, null, null, cb);
+      cb(null, null);
+    }
+    catch(ex) {
+      cb(ex);
+    }
   });
 };
 
@@ -1515,7 +1544,7 @@
  * @param callback(err, output) called once the operation completes.
  */
 Processor.prototype.fromRDF = function(statements, options, callback) {
-  // prepare graph map (maps graph name => subjects, lists, etc)
+  // prepare graph map (maps graph name => subjects, lists)
   var defaultGraph = {subjects: {}, listMap: {}};
   var graphs = {'': defaultGraph};
 
@@ -1539,7 +1568,7 @@
     // handle element in @list
     if(p === RDF_FIRST) {
       // create list entry as needed
-      var listMap = graphs[name].listMap;
+      var listMap = graph.listMap;
       if(!(s in listMap)) {
         var entry = listMap[s] = {};
       }
@@ -1556,7 +1585,7 @@
       // set next in list
       if(o.interfaceName === 'BlankNode') {
         // create list entry as needed
-        var listMap = graphs[name].listMap;
+        var listMap = graph.listMap;
         if(!(s in listMap)) {
           var entry = listMap[s] = {};
         }
@@ -1568,28 +1597,25 @@
       continue;
     }
 
-    // prepare to assign next JSON-LD value
-    var value;
-
     // if graph is not the default graph
     if(name !== '') {
       // add graph subject to default graph as needed
       if(!(name in defaultGraph.subjects)) {
-        value = defaultGraph.subjects[name] = {'@id': name};
+        defaultGraph.subjects[name] = {'@id': name};
       }
       else {
-        value = defaultGraph.subjects[name];
+        defaultGraph.subjects[name];
       }
     }
 
     // add subject to graph as needed
-    var subjects = graphs[name].subjects;
+    var subjects = graph.subjects;
     if(!(s in subjects)) {
-      value = subjects[s] = {'@id': s};
+      var value = subjects[s] = {'@id': s};
     }
     // use existing subject value
     else {
-      value = subjects[s];
+      var value = subjects[s];
     }
 
     // convert to @type unless options indicate to treat rdf:type as property
@@ -1605,7 +1631,7 @@
       // a bnode might be the beginning of a list, so add it to the list map
       if(o.interfaceName === 'BlankNode') {
         var id = object['@id'];
-        var listMap = graphs[name].listMap;
+        var listMap = graph.listMap;
         if(!(id in listMap)) {
           var entry = listMap[id] = {};
         }
@@ -1682,14 +1708,6 @@
  */
 Processor.prototype.toRDF = function(
   element, namer, subject, property, graph, callback) {
-  // recurse into arrays
-  if(_isArray(element)) {
-    for(var i in element) {
-      this.toRDF(element[i], namer, subject, property, graph, callback);
-    }
-    return;
-  }
-
   if(_isObject(element)) {
     // convert @value to object
     if(_isValue(element)) {
@@ -1730,7 +1748,7 @@
 
     // get subject @id (generate one if it is a bnode)
     var isBnode = _isBlankNode(element);
-    var id = isBnode ? namer.getName(input['@id']) : input['@id'];
+    var id = isBnode ? namer.getName(element['@id']) : element['@id'];
 
     // create object
     var object = {
@@ -1757,11 +1775,11 @@
     // recurse over subject properties in order
     var props = Object.keys(element).sort();
     for(var pi in props) {
-      var prop = props[pi];
+      var prop = p = props[pi];
 
       // convert @type to rdf:type
       if(prop === '@type') {
-        prop = RDF_TYPE;
+        p = RDF_TYPE;
       }
 
       // recurse into @graph
@@ -1771,13 +1789,13 @@
       }
 
       // skip keywords
-      if(_isKeyword(prop)) {
+      if(_isKeyword(p)) {
         continue;
       }
 
       // create new active property
       property = {
-        nominalValue: id,
+        nominalValue: p,
         interfaceName: 'IRI'
       };
 
@@ -1788,14 +1806,27 @@
     return;
   }
 
+  if(_isArray(element)) {
+    // recurse into arrays
+    for(var i in element) {
+      this.toRDF(element[i], namer, subject, property, graph, callback);
+    }
+    return;
+  }
+
   if(_isString(element)) {
-    // emit plain literal
+    // property can be null for string subject references in @graph
+    if(property === null) {
+      return;
+    }
+    // emit IRI for rdf:type, else plain literal
     var statement = {
       subject: _clone(subject),
       property: _clone(property),
       object: {
         nominalValue: element,
-        interfaceName: 'LiteralNode'
+        interfaceName: ((property.nominalValue === RDF_TYPE) ?
+          'IRI' : 'LiteralNode')
       }
     };
     if(graph !== null) {
@@ -1810,16 +1841,16 @@
       var datatype = XSD_BOOLEAN;
       var value = String(element);
     }
-    else if(_isInteger(element)) {
+    else if(_isDouble(element)) {
+      var datatype = XSD_DOUBLE;
+      // printf('%1.15e') equivalent
+      var value = element.toExponential(15).replace(
+        /(e(?:\+|-))([0-9])$/, '$10$2');
+    }
+    else {
       var datatype = XSD_INTEGER;
       var value = String(element);
     }
-    else {
-      var datatype = XSD_DOUBLE;
-      // printf('%1.16e') equivalent
-      var value = element.toExponential(16).replace(
-        /(e(?:\+|-))([0-9])$/, '$10$2');
-    }
 
     // emit typed literal
     var statement = {
@@ -2034,8 +2065,8 @@
       }
       // convert double to @value
       else if(_isDouble(o)) {
-        // do special JSON-LD double format, printf('%1.16e') JS equivalent
-        o = o.toExponential(16).replace(/(e(?:\+|-))([0-9])$/, '$10$2');
+        // do special JSON-LD double format, printf('%1.15e') JS equivalent
+        o = o.toExponential(15).replace(/(e(?:\+|-))([0-9])$/, '$10$2');
         o = {'@value': o, '@type': XSD_DOUBLE};
       }
       // convert integer to @value
@@ -3394,7 +3425,7 @@
   }
 
   // prepend base
-  value = base + value;
+  value = _prependBase(base, value);
 
   // value must now be an absolute IRI
   if(!_isAbsoluteIri(value)) {
@@ -3461,13 +3492,31 @@
 
   // prepend base to term
   if(!_isUndefined(base)) {
-    term = base + term;
+    term = _prependBase(base, term);
   }
 
   return term;
 }
 
 /**
+ * Prepends a base IRI to the given relative IRI.
+ *
+ * @param base the base IRI.
+ * @param iri the relative IRI.
+ *
+ * @return the absolute IRI.
+ */
+function _prependBase(base, iri) {
+  if(iri === '' || iri.indexOf('#') === 0) {
+    return base + iri;
+  }
+  else {
+    // prepend last directory for base
+    return base.substr(0, base.lastIndexOf('/') + 1) + iri;
+  }
+}
+
+/**
  * Gets the initial context.
  *
  * @return the initial context.
@@ -3990,35 +4039,28 @@
     }
 
     // create RDF statement
-    var s = {subject: {}, property: {}, object: {}};
+    var s = {};
 
     // get subject
-    if(_isUndefined(match[2])) {
-      s.subject.nominalValue = match[1];
-      s.subject.interfaceName = 'IRI';
+    if(!_isUndefined(match[1])) {
+      s.subject = {nominalValue: match[1], interfaceName: 'IRI'};
     }
     else {
-      s.subject.nominalValue = match[2];
-      s.subject.interfaceName = 'BlankNode';
+      s.subject = {nominalValue: match[2], interfaceName: 'BlankNode'};
     }
 
     // get property
     s.property = {nominalValue: match[3], interfaceName: 'IRI'};
 
     // get object
-    if(_isUndefined(match[6])) {
-      if(_isUndefined(match[5])) {
-        s.object.nominalValue = match[4];
-        s.object.interfaceName = 'IRI';
-      }
-      else {
-        s.object.nominalValue = match[5];
-        s.object.interfaceName = 'BlankNode';
-      }
+    if(!_isUndefined(match[4])) {
+      s.object = {nominalValue: match[4], interfaceName: 'IRI'};
+    }
+    else if(!_isUndefined(match[5])) {
+      s.object = {nominalValue: match[5], interfaceName: 'BlankNode'};
     }
     else {
-      s.object.nominalValue = match[6];
-      s.object.interfaceName = 'LiteralNode';
+      s.object = {nominalValue: match[6], interfaceName: 'LiteralNode'};
       if(!_isUndefined(match[7])) {
         s.object.datatype = {nominalValue: match[7], interfaceName: 'IRI'};
       }
@@ -4043,6 +4085,58 @@
 }
 
 /**
+ * Converts an RDF statement to an N-Quad string (a single quad).
+ *
+ * @param statement the RDF statement to convert.
+ *
+ * @return the N-Quad string.
+ */
+function _toNQuad(statement) {
+  var s = statement.subject;
+  var p = statement.property;
+  var o = statement.object;
+  var g = statement.name || null;
+
+  var quad = '';
+
+  // subject is an IRI or bnode
+  if(s.interfaceName === 'IRI') {
+    quad += '<' + s.nominalValue + '>';
+  }
+  else {
+    quad += s.nominalValue;
+  }
+
+  // property is always an IRI
+  quad += ' <' + p.nominalValue + '> ';
+
+  // object is IRI, bnode, or literal
+  if(o.interfaceName === 'IRI') {
+    quad += '<' + o.nominalValue + '>';
+  }
+  else if(o.interfaceName === 'BlankNode') {
+    quad += o.nominalValue;
+  }
+  else {
+    quad += '"' + o.nominalValue + '"';
+    if('datatype' in o) {
+      quad += '^^<' + o.datatype.nominalValue + '>';
+    }
+    else if('language' in o) {
+      quad += '@' + o.language;
+    }
+  }
+
+  // graph
+  if(g !== null) {
+    quad += ' <' + g.nominalValue + '>';
+  }
+
+  quad += ' .\n';
+  return quad;
+}
+
+/**
  * Creates a new UniqueNamer. A UniqueNamer issues unique names, keeping
  * track of any previously issued names.
  *
--- a/playground/playground.js	Mon Apr 30 16:05:56 2012 +0400
+++ b/playground/playground.js	Tue May 01 21:42:49 2012 +0800
@@ -122,7 +122,7 @@
       getParameterByName('param'), 'param', 'param');
 
     var startTab = getParameterByName('startTab');
-    if (startTab) {
+    if(startTab) {
         // strip 'tab-' to get the tab's panel's I D
         $('#tabs').tabs("select", "#"+startTab.substr(4));
     }
@@ -132,8 +132,9 @@
     $.when(jsonLdDeferred, frameDeferred, contextDeferred, paramDeferred)
       .done(function() {
         // Maintain backwards permalink compatability
-        if (queryData['param'] && !(queryData['frame'] || queryData['context'])) {
-            queryData['frame'] = queryData['context'] = queryData['param'];
+        if(queryData['param'] &&
+          !(queryData['frame'] || queryData['context'])) {
+          queryData['frame'] = queryData['context'] = queryData['param'];
         }
         // populate UI with data
         playground.populateWithJSON(queryData);
@@ -159,7 +160,7 @@
     playground.activeTab = ui.tab.id;
     if(ui.tab.id === 'tab-compacted' || ui.tab.id === 'tab-framed') {
       // if the 'compact' or 'frame' tab is selected, display the appropriate
-      // input textarea 
+      // input textarea
       $('#markup').addClass('compressed');
 
       if(ui.tab.id === 'tab-compacted') {
@@ -239,13 +240,18 @@
         callback();
       });
     }
-    else if(playground.activeTab === 'tab-turtle') {
-      jsonld.turtle(input, options, function(err, turtle) {
+    else if(playground.activeTab === 'tab-nquads') {
+      options.format = 'application/nquads';
+      var nquads = [];
+      jsonld.toRDF(input, options, function(err, quad) {
         if(err) {
           return callback(err);
         }
-        $('#turtle').html(playground.htmlEscape(turtle));
-        callback();
+        if(quad === null) {
+          $('#nquads').html(playground.htmlEscape(nquads.sort().join('')));
+          return callback();
+        }
+        nquads.push(quad);
       });
     }
   };
@@ -286,7 +292,7 @@
         toValidate = $('#frame').val();
         needParam = true;
     }
-    
+
     if (needParam) {
         try {
           var param = JSON.parse(toValidate);
@@ -317,7 +323,7 @@
       // generate a link for current data
       var link = '?json-ld=' + encodeURIComponent(JSON.stringify(input));
       if($('#frame').val().length > 0) {
-        link += '&frame=' + 
+        link += '&frame=' +
             encodeURIComponent($("#frame").val());
       }
       if($('#context').val().length > 0) {
@@ -325,7 +331,7 @@
             encodeURIComponent($("#context").val());
       }
 
-      // Start at the currently active tab 
+      // Start at the currently active tab
       link += '&startTab=' + encodeURIComponent(playground.activeTab);
 
       var permalink = '<a href="' + link + '">permalink</a>';
@@ -402,7 +408,7 @@
 
     if('context' in data && data.context !== null) {
       hasData = true;
-      // fill the context input box with the given context 
+      // fill the context input box with the given context
       $('#context').val(js_beautify(
         data.context, {'indent_size': 2, 'brace_style': 'expand'}));
     }
@@ -436,12 +442,12 @@
       data.markup = JSON.stringify(playground.examples[name]);
 
       if(name in playground.frames) {
-        // fill the frame with the example 
+        // fill the frame with the example
         data.frame = JSON.stringify(playground.frames[name]);
       }
 
       if(name in playground.contexts) {
-        // fill the context with the example 
+        // fill the context with the example
         data.contexts = JSON.stringify(playground.contexts[name]);
       }
       else if('@context' in playground.examples[name]) {
--- a/spec/latest/json-ld-api/index.html	Mon Apr 30 16:05:56 2012 +0400
+++ b/spec/latest/json-ld-api/index.html	Tue May 01 21:42:49 2012 +0800
@@ -495,6 +495,7 @@
           <dt>object or object[] or URL input</dt>
           <dd>The JSON-LD object or array of JSON-LD objects to perform the expansion upon or an
             <tref>IRI</tref> referencing the JSON-LD document to expand.</dd>
+          <dt>ObjectOrURL? context</dt>
           <dd>An optional external context to use additionally to the context embedded in
             <code>input</code> when expanding the <code>input</code>.</dd>
           <dt>JsonLdCallback callback</dt>
@@ -633,9 +634,6 @@
           <dt>object or object[] or URL input</dt>
           <dd>The JSON-LD object or array of JSON-LD objects to convert to RDF or an <tref>IRI</tref>
             referencing the JSON-LD document to convert to RDF.</dd>
-          <dt>ObjectOrURL? context</dt>
-          <dd>An external context to use additionally to the context embedded in
-            <code>input</code> when expanding the <code>input</code>.</dd>
           <dt>StatementCallback callback</dt>
           <dd>A callback that is called when a <a>Statement</a> is created from processing
             the given <code>input</code>.</dd>
@@ -1371,9 +1369,12 @@
 <section>
 <h3>Expansion Algorithm</h3>
 
-<p>The algorithm takes three input variables: an <tref>active context</tref>, an <tref>active property</tref>,
-  and an <em>element</em> to be expanded. To begin, the <tref>active context</tref> is set to the <tref>initial
-  context</tref>, <tref>active property</tref> is set to <tref>null</tref>, and <em>element</em> is set to the <tref>JSON-LD
+<p>The algorithm takes three input variables: an <tref>active context</tref>,  an <tref>active property</tref>, and an <em>element</em> to be expanded. To 
+  begin, the <tref>active context</tref> is set to the result of performing, <a 
+  href="#context-processing">Context Processing</a> on the passed 
+  <em>context</em>, or to the <tref>initial context</tref> if <em>context</em> 
+  is <tref>null</tref>, <tref>active property</tref> is set to 
+  <tref>null</tref>, and <em>element</em> is set to the <tref>JSON-LD 
   input</tref>.</p>
 <ol class="algorithm">
   <li>If <em>element</em> is an <tref>array</tref>, process each entry in <em>element</em> recursively
@@ -1851,7 +1852,8 @@
             <em>subjects</em> initialized using a new <tref>JSON object</tref>
             with <code>@id</code> set to <em>name</em> as <em>subject</em>.
             Otherwise, use that existing entrpy as <em>subject</em>.</li>
-          <li>For each <em>property</em> and <em>value</em> in <em>element</em> other than <code>@id</code>:
+          <li>For each <em>property</em> and <em>value</em> in <em>element</em> other than <code>@id</code>
+            ordered by <em>property</em>:
             <ol class="algorithm">
               <li>If <em>property</em> is a keyword, copy <code>property</code> and <code>value</code>
                 to <code>subject</code>.</li>
@@ -2154,7 +2156,8 @@
           Otherwise, if <em>element</em> does not have a <code>@id</code> property, set the <tref>active
           subject</tref> to newly generated <tref>blank node</tref>.</li>
         <li>
-          Process each <em>property</em> and <em>value</em> in <em>element</em> as follows:
+          Process each <em>property</em> and <em>value</em> in <em>element</em>, ordered by
+          <em>property</em>, as follows:
           <ol class="algorithm">
             <li>
               If <em>property</em> is <code>@type</code>, set the <tref>active property</tref>
--- a/spec/latest/json-ld-syntax/index.html	Mon Apr 30 16:05:56 2012 +0400
+++ b/spec/latest/json-ld-syntax/index.html	Tue May 01 21:42:49 2012 +0800
@@ -1961,13 +1961,13 @@
         "@id": "http://manu.sporny.org/i/public",
         "@type": "foaf:Person",
         "name": "Manu Sporny",
-        "knows" "http://greggkellogg.net/foaf#me"
+        "knows": "http://greggkellogg.net/foaf#me"
       },
       {
         "@id": "http://greggkellogg.net/foaf#me",
         "@type": "foaf:Person",
         "name": "Gregg Kellogg",
-        "knows" "http://manu.sporny.org/i/public"
+        "knows": "http://manu.sporny.org/i/public"
       }
     ]
   }
@@ -1988,14 +1988,14 @@
       "@id": "http://manu.sporny.org/i/public",
       "@type": "foaf:Person",
       "name": "Manu Sporny",
-      "knows" "http://greggkellogg.net/foaf#me"
+      "knows": "http://greggkellogg.net/foaf#me"
     },
     {
       ****"@context": ...,****
       "@id": "http://greggkellogg.net/foaf#me",
       "@type": "foaf:Person",
       "name": "Gregg Kellogg",
-      "knows" "http://manu.sporny.org/i/public"
+      "knows": "http://manu.sporny.org/i/public"
     }
   ****]****
   -->
@@ -2023,13 +2023,13 @@
         "@id": "http://manu.sporny.org/i/public",
         "@type": "foaf:Person",
         "name": "Manu Sporny",
-        "knows" "http://greggkellogg.net/foaf#me"
+        "knows": "http://greggkellogg.net/foaf#me"
       },
       {
         "@id": "http://greggkellogg.net/foaf#me",
         "@type": "foaf:Person",
         "name": "Gregg Kellogg",
-        "knows" "http://manu.sporny.org/i/public"
+        "knows": "http://manu.sporny.org/i/public"
       },
       "http://www.markus-lanthaler.com/"
     ]
--- a/test-suite/context.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ b/test-suite/context.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -9,10 +9,9 @@
     "expect":   {"@id": "test:informationResourceResults", "@type": "@id"},
     "frame":    {"@id": "test:input", "@type": "@id"},
     "input":    {"@id": "test:informationResourceInput", "@type": "@id"},
-    "optimize": {"@id": "test:input", "@type": "@id"},
     "name":     "dc:title",
+    "optimize": {"@id": "test:input", "@type": "@id"},
     "purpose":  "test:purpose",
-    "sequence": {"@id": "jld:sequence", "@type": "@id", "@container": "@list"},
-    "sparql":   {"@id": "test:expectedResults", "@type": "@id"}
+    "sequence": {"@id": "jld:sequence", "@type": "@id", "@container": "@list"}
   }
 }
--- a/test-suite/manifest.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ b/test-suite/manifest.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -10,6 +10,6 @@
     "tests/frame-manifest.jsonld",
     "tests/fromRdf-manifest.jsonld",
     "tests/normalize-manifest.jsonld",
-    "tests/rdf-manifest.jsonld"
+    "tests/toRdf-manifest.jsonld"
   ]
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0001-in.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,5 @@
+<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
+<http://example.com/Subj1> <http://example.com/prop1> <http://example.com/Obj1> .
+<http://example.com/Subj1> <http://example.com/prop2> "Plain" .
+<http://example.com/Subj1> <http://example.com/prop2> "2012-05-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Subj1> <http://example.com/prop2> "English"@en .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0001-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,10 @@
+[{
+  "@id": "http://example.com/Subj1",
+  "@type": ["http://example.com/Type"],
+  "http://example.com/prop1": [{"@id": "http://example.com/Obj1"}],
+  "http://example.com/prop2": [
+    {"@value": "Plain"},
+    {"@value": "2012-05-12", "@type": "http://www.w3.org/2001/XMLSchema#date"},
+    {"@value": "English", "@language": "en"}
+  ]
+}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0001.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-[{
-  "@id": "http://example.com/Subj1",
-  "@type": ["http://example.com/Type"],
-  "http://example.com/prop1": [{"@id": "http://example.com/Obj1"}],
-  "http://example.com/prop2": [
-    {"@value": "Plain"},
-    {"@value": "2012-05-12", "@type": "http://www.w3.org/2001/XMLSchema#date"},
-    {"@value": "English", "@language": "en"}
-  ]
-}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0001.nq	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
-<http://example.com/Subj1> <http://example.com/prop1> <http://example.com/Obj1> .
-<http://example.com/Subj1> <http://example.com/prop2> "Plain" .
-<http://example.com/Subj1> <http://example.com/prop2> "2012-05-12"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Subj1> <http://example.com/prop2> "English"@en .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0002-in.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,5 @@
+<http://example.com/Subj1> <http://example.com/prop> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Subj1> <http://example.com/prop> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
+<http://example.com/Subj1> <http://example.com/prop> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
+<http://example.com/Subj1> <http://example.com/prop> "1.1"^^<http://www.w3.org/2001/XMLSchema#decimal> .
+<http://example.com/Subj1> <http://example.com/prop> "1.1E1"^^<http://www.w3.org/2001/XMLSchema#double> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0002-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,10 @@
+[{
+  "@id": "http://example.com/Subj1",
+  "http://example.com/prop": [
+    {"@value": "true", "@type": "http://www.w3.org/2001/XMLSchema#boolean"},
+    {"@value": "false", "@type": "http://www.w3.org/2001/XMLSchema#boolean"},
+    {"@value": "1", "@type": "http://www.w3.org/2001/XMLSchema#integer"},
+    {"@value": "1.1", "@type": "http://www.w3.org/2001/XMLSchema#decimal"},
+    {"@value": "1.1E1", "@type": "http://www.w3.org/2001/XMLSchema#double"}
+  ]
+}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0002.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-[{
-  "@id": "http://example.com/Subj1",
-  "http://example.com/prop": [
-    true,
-    false,
-    1,
-    {"@value": "1.1", "@type": "http://www.w3.org/2001/XMLSchema#decimal"},
-    1.1E1
-  ]
-}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0002.nq	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<http://example.com/Subj1> <http://example.com/prop> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Subj1> <http://example.com/prop> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Subj1> <http://example.com/prop> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Subj1> <http://example.com/prop> "1.1"^^<http://www.w3.org/2001/XMLSchema#decimal> .
-<http://example.com/Subj1> <http://example.com/prop> "1.1E1"^^<http://www.w3.org/2001/XMLSchema#double> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0003-in.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,6 @@
+<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/SubType> .
+<http://example.com/Subj1> <http://example.com/ref> _:a .
+<http://example.com/Subj1> <http://example.com/ref> <http://example.com/Subj2> .
+<http://example.com/Subj2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
+<http://example.com/Subj2> <http://example.com/ref> <http://example.com/Subj1> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0003-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,19 @@
+[
+  {
+    "@id": "_:a",
+    "@type": ["http://example.com/SubType"]
+  },
+  {
+    "@id": "http://example.com/Subj1",
+    "@type": ["http://example.com/Type"],
+    "http://example.com/ref": [
+      {"@id": "_:a"},
+      {"@id": "http://example.com/Subj2"}
+    ]
+  },
+  {
+    "@id": "http://example.com/Subj2",
+    "@type": ["http://example.com/Type"],
+    "http://example.com/ref": [{"@id": "http://example.com/Subj1"}]
+  }
+]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0003.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-[
-  {
-    "@id": "_:a",
-    "@type": ["http://example.com/SubType"]
-  },
-  {
-    "@id": "http://example.com/Subj1",
-    "@type": ["http://example.com/Type"],
-    "http://example.com/ref": [
-      {"@id": "_:a"},
-      {"@id": "http://example.com/Subj2"}
-    ]
-  },
-  {
-    "@id": "http://example.com/Subj2",
-    "@type": ["http://example.com/Type"],
-    "http://example.com/ref": [{"@id": "http://example.com/Subj1"}]
-  }
-]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0003.nq	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/SubType> .
-<http://example.com/Subj1> <http://example.com/ref> _:a .
-<http://example.com/Subj1> <http://example.com/ref> <http://example.com/Subj2> .
-<http://example.com/Subj2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
-<http://example.com/Subj2> <http://example.com/ref> <http://example.com/Subj1> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0004-in.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,10 @@
+<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "bananna" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Subj1> <http://example.com/literalList> _:a .
+<http://example.com/Subj1> <http://example.com/emptyList> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/iri> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+<http://example.com/Subj1> <http://example.com/iriList> _:c .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0004-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,16 @@
+[{
+  "@id": "http://example.com/Subj1",
+  "@type": ["http://example.com/Type"],
+  "http://example.com/literalList": [{
+    "@list": [
+      {"@value": "apple"},
+      {"@value": "bananna"}
+    ]
+  }],
+  "http://example.com/emptyList": [{
+    "@list": []
+  }],
+  "http://example.com/iriList": [{
+    "@list": [{"@id": "http://example.com/iri"}]
+  }]
+}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0004.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-[{
-  "@id": "http://example.com/Subj1",
-  "@type": ["http://example.com/Type"],
-  "http://example.com/literalList": [{
-    "@list": [
-      {"@value": "apple"},
-      {"@value": "bananna"}
-    ]
-  }],
-  "http://example.com/emptyList": [{
-    "@list": []
-  }],
-  "http://example.com/iriList": [{
-    "@list": [{"@id": "http://example.com/iri"}]
-  }]
-}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0004.nq	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "apple" .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "bananna" .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Subj1> <http://example.com/literalList> _:a .
-<http://example.com/Subj1> <http://example.com/emptyList> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/iri> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Subj1> <http://example.com/iriList> _:c .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0005-in.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,9 @@
+<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> <http://example.com/U> .
+<http://example.com/Subj1> <http://example.com/ref> <http://example.com/U> <http://example.com/U> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" <http://example.com/U> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b <http://example.com/U> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" <http://example.com/U> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/U> .
+<http://example.com/Subj1> <http://example.com/list> _:a <http://example.com/U> .
+<http://example.com/U> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Graph> .
+<http://example.com/U> <http://example.com/name> "Graph" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0005-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,18 @@
+[{
+  "@id": "http://example.com/U",
+  "@graph": [
+    {
+      "@id": "http://example.com/Subj1",
+      "@type": ["http://example.com/Type"],
+      "http://example.com/ref": [{"@id": "http://example.com/U"}],
+      "http://example.com/list": [{
+        "@list": [
+          {"@value": "a"},
+          {"@value": "b"}
+        ]
+      }]
+    }
+  ],
+  "@type": ["http://example.com/Graph"],
+  "http://example.com/name": [{"@value": "Graph"}]
+}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0005.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-[{
-  "@id": "http://example.com/U",
-  "@graph": [
-    {
-      "@id": "http://example.com/Subj1",
-      "@type": ["http://example.com/Type"],
-      "http://example.com/ref": [{"@id": "http://example.com/U"}],
-      "http://example.com/list": [{
-        "@list": [
-          {"@value": "a"},
-          {"@value": "b"}
-        ]
-      }]
-    }
-  ],
-  "@type": ["http://example.com/Graph"],
-  "http://example.com/name": [{"@value": "Graph"}]
-}]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0005.nq	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> <http://example.com/U> .
-<http://example.com/Subj1> <http://example.com/ref> <http://example.com/U> <http://example.com/U> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" <http://example.com/U> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b <http://example.com/U> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" <http://example.com/U> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/U> .
-<http://example.com/Subj1> <http://example.com/list> _:a <http://example.com/U> .
-<http://example.com/U> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Graph> .
-<http://example.com/U> <http://example.com/name> "Graph" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0006-in.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,14 @@
+<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> <http://example.com/U> .
+<http://example.com/Subj1> <http://example.com/ref> <http://example.com/U> <http://example.com/U> .
+<http://example.com/Subj1> <http://example.com/list> _:a <http://example.com/U> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" <http://example.com/U> .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b <http://example.com/U> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" <http://example.com/U> .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/U> .
+<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type2> <http://example.com/V> .
+<http://example.com/Subj1> <http://example.com/ref> <http://example.com/V> <http://example.com/V> .
+<http://example.com/Subj1> <http://example.com/list> _:c <http://example.com/V> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" <http://example.com/V> .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:d <http://example.com/V> .
+_:d <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" <http://example.com/V> .
+_:d <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/V> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0006-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,34 @@
+[
+  {
+    "@id": "http://example.com/U",
+    "@graph": [
+      {
+        "@id": "http://example.com/Subj1",
+        "@type": ["http://example.com/Type"],
+        "http://example.com/ref": [{"@id": "http://example.com/U"}],
+        "http://example.com/list": [{
+          "@list": [
+            {"@value": "a"},
+            {"@value": "b"}
+          ]
+        }]
+      }
+    ]
+  },
+  {
+    "@id": "http://example.com/V",
+    "@graph": [
+      {
+        "@id": "http://example.com/Subj1",
+        "@type": ["http://example.com/Type2"],
+        "http://example.com/ref": [{"@id": "http://example.com/V"}],
+        "http://example.com/list": [{
+          "@list": [
+            {"@value": "c"},
+            {"@value": "d"}
+          ]
+        }]
+      }
+    ]
+  }
+]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0006.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-[
-  {
-    "@id": "http://example.com/U",
-    "@graph": [
-      {
-        "@id": "http://example.com/Subj1",
-        "@type": ["http://example.com/Type"],
-        "http://example.com/ref": [{"@id": "http://example.com/U"}],
-        "http://example.com/list": [{
-          "@list": [
-            {"@value": "a"},
-            {"@value": "b"}
-          ]
-        }]
-      }
-    ]
-  },
-  {
-    "@id": "http://example.com/V",
-    "@graph": [
-      {
-        "@id": "http://example.com/Subj1",
-        "@type": ["http://example.com/Type2"],
-        "http://example.com/ref": [{"@id": "http://example.com/V"}],
-        "http://example.com/list": [{
-          "@list": [
-            {"@value": "c"},
-            {"@value": "d"}
-          ]
-        }]
-      }
-    ]
-  }
-]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0006.nq	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> <http://example.com/U> .
-<http://example.com/Subj1> <http://example.com/ref> <http://example.com/U> <http://example.com/U> .
-<http://example.com/Subj1> <http://example.com/list> _:a <http://example.com/U> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" <http://example.com/U> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b <http://example.com/U> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" <http://example.com/U> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/U> .
-<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type2> <http://example.com/V> .
-<http://example.com/Subj1> <http://example.com/ref> <http://example.com/V> <http://example.com/V> .
-<http://example.com/Subj1> <http://example.com/list> _:c <http://example.com/V> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" <http://example.com/V> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:d <http://example.com/V> .
-_:d <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" <http://example.com/V> .
-_:d <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/V> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0007-in.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,5 @@
+<http://data.wikipedia.org/snaks/Assertions> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://data.wikipedia.org/vocab#SnakSet> .
+<http://data.wikipedia.org/snaks/Assertions> <http://data.wikipedia.org/vocab#assertedBy> "http://gregkellogg.net/foaf#me" .
+<http://data.wikipedia.org/snaks/BerlinFact> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://data.wikipedia.org/vocab#Snak> <http://data.wikipedia.org/snaks/Assertions> .
+<http://data.wikipedia.org/snaks/BerlinFact> <http://data.wikipedia.org/vocab#assertedBy> "http://www.statistik-berlin-brandenburg.de/" <http://data.wikipedia.org/snaks/Assertions> .
+<http://en.wikipedia.org/wiki/Berlin> <http://data.wikipedia.org/vocab#population> "3499879"^^<http://www.w3.org/2001/XMLSchema#integer> <http://data.wikipedia.org/snaks/BerlinFact> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0007-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,27 @@
+[
+  {
+    "@id": "http://data.wikipedia.org/snaks/Assertions",
+    "@type": ["http://data.wikipedia.org/vocab#SnakSet"],
+    "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://gregkellogg.net/foaf#me"}
+    ],
+    "@graph": [
+      {
+        "@id": "http://data.wikipedia.org/snaks/BerlinFact",
+        "@type": ["http://data.wikipedia.org/vocab#Snak"],
+        "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://www.statistik-berlin-brandenburg.de/"}]
+      }
+    ]
+  },
+  {
+    "@id": "http://data.wikipedia.org/snaks/BerlinFact",
+    "@graph": [
+      {
+        "@id": "http://en.wikipedia.org/wiki/Berlin",
+        "http://data.wikipedia.org/vocab#population": [{
+          "@value": "3499879",
+          "@type": "http://www.w3.org/2001/XMLSchema#integer"
+        }]
+      }
+    ]
+  }
+]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0007.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-[
-  {
-    "@id": "http://data.wikipedia.org/snaks/Assertions",
-    "@type": ["http://data.wikipedia.org/vocab#SnakSet"],
-    "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://gregkellogg.net/foaf#me"}
-    ],
-    "@graph": [
-      {
-        "@id": "http://data.wikipedia.org/snaks/BerlinFact",
-        "@type": ["http://data.wikipedia.org/vocab#Snak"],
-        "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://www.statistik-berlin-brandenburg.de/"}]
-      }
-    ]
-  },
-  {
-    "@id": "http://data.wikipedia.org/snaks/BerlinFact",
-    "@graph": [
-      {
-        "@id": "http://en.wikipedia.org/wiki/Berlin",
-        "http://data.wikipedia.org/vocab#population": [3499879]
-      }
-    ]
-  }
-]
\ No newline at end of file
--- a/test-suite/tests/fromRdf-0007.nq	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<http://data.wikipedia.org/snaks/Assertions> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://data.wikipedia.org/vocab#SnakSet> .
-<http://data.wikipedia.org/snaks/Assertions> <http://data.wikipedia.org/vocab#assertedBy> "http://gregkellogg.net/foaf#me" .
-<http://data.wikipedia.org/snaks/BerlinFact> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://data.wikipedia.org/vocab#Snak> <http://data.wikipedia.org/snaks/Assertions> .
-<http://data.wikipedia.org/snaks/BerlinFact> <http://data.wikipedia.org/vocab#assertedBy> "http://www.statistik-berlin-brandenburg.de/" <http://data.wikipedia.org/snaks/Assertions> .
-<http://en.wikipedia.org/wiki/Berlin> <http://data.wikipedia.org/vocab#population> "3499879"^^<http://www.w3.org/2001/XMLSchema#integer> <http://data.wikipedia.org/snaks/BerlinFact> .
--- a/test-suite/tests/fromRdf-manifest.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ b/test-suite/tests/fromRdf-manifest.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -2,51 +2,51 @@
   "@context": "http://json-ld.org/test-suite/context.jsonld",
   "@id": "",
   "@type": "jld:Manifest",
-  "rdfs:comment": "RDF to JSON-LD tests take either N-Triples, N-Quads, Turtle or Trig Input",
+  "rdfs:comment": "RDF to JSON-LD tests take N-Quads Input",
   "name": "fromRdf",
   "sequence": [
     {
       "@type": ["test:TestCase", "jld:FromRDFTest"],
       "name": "Object Lists",
       "purpose": "Tests generation using different types of objects.",
-      "input": "fromRdf-0001.nq",
-      "expect": "fromRdf-0001.jsonld"
+      "input": "fromRdf-0001-in.nq",
+      "expect": "fromRdf-0001-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:FromRDFTest"],
       "name": "Native Types",
       "purpose": "Use native datatypes, where possible.",
-      "input": "fromRdf-0002.nq",
-      "expect": "fromRdf-0002.jsonld"
+      "input": "fromRdf-0002-in.nq",
+      "expect": "fromRdf-0002-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:FromRDFTest"],
       "name": "BNodes and references",
       "purpose": "BNode name generation and references between resources.",
-      "input": "fromRdf-0003.nq",
-      "expect": "fromRdf-0003.jsonld"
+      "input": "fromRdf-0003-in.nq",
+      "expect": "fromRdf-0003-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:FromRDFTest"],
       "name": "Lists",
       "purpose": "Multiple lists with different types of element.",
-      "input": "fromRdf-0004.nq",
-      "expect": "fromRdf-0004.jsonld"
-    }, {
-      "@type": ["test:TestCase", "jld:FromRDFTest"],
-      "name": "TriG document with list",
-      "purpose": "Uses a named graph containing a list.",
-      "input": "fromRdf-0005.nq",
-      "expect": "fromRdf-0005.jsonld"
+      "input": "fromRdf-0004-in.nq",
+      "expect": "fromRdf-0004-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:FromRDFTest"],
-      "name": "TriG with two graphs having same subject but different values",
-      "purpose": "Ensure that properties and list elements aren't confused between graphs.",
-      "input": "fromRdf-0006.nq",
-      "expect": "fromRdf-0006.jsonld"
+      "name": "Document with list",
+      "purpose": "Uses a named graph containing a list.",
+      "input": "fromRdf-0005-in.nq",
+      "expect": "fromRdf-0005-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:FromRDFTest"],
-      "name": "TriG graph with multiple named graphs",
+      "name": "Two graphs having same subject but different values",
+      "purpose": "Ensure that properties and list elements aren't confused between graphs.",
+      "input": "fromRdf-0006-in.nq",
+      "expect": "fromRdf-0006-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FromRDFTest"],
+      "name": "Graph with multiple named graphs",
       "purpose": "Testing @graph recursion.",
-      "input": "fromRdf-0007.nq",
-      "expect": "fromRdf-0007.jsonld"
+      "input": "fromRdf-0007-in.nq",
+      "expect": "fromRdf-0007-out.jsonld"
     }
   ]
 }
--- a/test-suite/tests/normalize-0014-out.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ b/test-suite/tests/normalize-0014-out.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -9,7 +9,7 @@
     ],
     "http://example.org/vocab#double": [
       {
-        "@value": "1.2300000000000000e+00",
+        "@value": "1.230000000000000e+00",
         "@type": "http://www.w3.org/2001/XMLSchema#double"
       }
     ],
--- a/test-suite/tests/rdf-0001.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@id": "http://greggkellogg.net/foaf#me",
-  "http://xmlns.com/foaf/0.1/name": "Gregg Kellogg"
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0001.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-	<http://greggkellogg.net/foaf#me> foaf:name "Gregg Kellogg" .
-}
--- a/test-suite/tests/rdf-0002.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-{
-  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:name": "Gregg Kellogg"
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0002.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-	<http://greggkellogg.net/foaf#me> foaf:name "Gregg Kellogg" .
-}
--- a/test-suite/tests/rdf-0003.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
-  "@type": "foaf:Person"
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0003.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  ?s a foaf:Person .
-}
--- a/test-suite/tests/rdf-0004.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-{
-  "http://www.w3.org/2000/01/rdf-schema#label": {
-    "@value": "A plain literal with a lang tag.",
-    "@language": "en-us"
-  }
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0004.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  _:s rdfs:label "A plain literal with a lang tag."@en-us .
-}
--- a/test-suite/tests/rdf-0005.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-{
-  "@id": "http://greggkellogg.net/foaf#me",
-  "http://xmlns.com/foaf/0.1/knows": {
-    "http://xmlns.com/foaf/0.1/name": {"@value": "Herman Iván", "@language": "hu"}
-  }
-}
--- a/test-suite/tests/rdf-0005.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows [ foaf:name "Herman Iv\u00E1n"@hu ].
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0006.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{
-  "@id":  "http://greggkellogg.net/foaf#me",
-  "http://purl.org/dc/terms/created":  {
-    "@value": "1957-02-27",
-    "@type": "http://www.w3.org/2001/XMLSchema#date"
-  }
-}
--- a/test-suite/tests/rdf-0006.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-PREFIX dc: <http://purl.org/dc/terms/>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> dc:created "1957-02-27"^^xsd:date
-}
--- a/test-suite/tests/rdf-0007.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@id": "http://greggkellogg.net/foaf#me",
-  "@type": "http://xmlns.com/foaf/0.1/Person"
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0007.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> rdf:type foaf:Person
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0008.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": {"d": "http://example.com/default#"},
-  "d:foo": "bar"
-}
--- a/test-suite/tests/rdf-0008.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-ASK WHERE {
-  _:a <http://example.com/default#foo> "bar" .
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0009.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": {"": "http://example.com/default#"},
-  ":foo": "bar"
-}
--- a/test-suite/tests/rdf-0009.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-ASK WHERE {
-  _:a <http://example.com/default#foo> "bar" .
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0010.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-{
-  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {
-    "@id": "http://manu.sporny.org/#me",
-    "foaf:name": "Manu Sporny"
-  }
-}
--- a/test-suite/tests/rdf-0010.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows <http://manu.sporny.org/#me> .
-  <http://manu.sporny.org/#me> foaf:name "Manu Sporny" .
-}
--- a/test-suite/tests/rdf-0011.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {
-    "foaf:name": "Dave Longley"
-  }
-}
--- a/test-suite/tests/rdf-0011.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ?o .
-  ?o foaf:name "Dave Longley" .
-}
--- a/test-suite/tests/rdf-0012.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": ["Manu Sporny", "Dave Longley"]
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0012.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows "Manu Sporny", "Dave Longley" .
-}
--- a/test-suite/tests/rdf-0013.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {"@list": []}
-}
--- a/test-suite/tests/rdf-0013.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows [] .
-}
--- a/test-suite/tests/rdf-0014.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {"@list": ["Manu Sporny"]}
-}
--- a/test-suite/tests/rdf-0014.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ("Manu Sporny") .
-}
--- a/test-suite/tests/rdf-0015.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {"@list": ["Manu Sporny", "Dave Longley"]}
-}
--- a/test-suite/tests/rdf-0015.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ("Manu Sporny" "Dave Longley") .
-}
--- a/test-suite/tests/rdf-0016.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@id": "",
-  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0016.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  <http://json-ld.org/test-suite/tests/rdf-0016.jsonld> a rdfs:Resource
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0017.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@id": "a/b",
-  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0017.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  <http://json-ld.org/test-suite/tests/a/b> a rdfs:Resource
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0018.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@id": "#frag",
-  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0018.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  <http://json-ld.org/test-suite/tests/rdf-0018.jsonld#frag> a rdfs:Resource
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0019.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/",
-    "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id"}
-  },
-  "@id":    "http://greggkellogg.net/foaf#me",
-  "knows":  "http://manu.sporny.org/#me"
-}
--- a/test-suite/tests/rdf-0019.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows <http://manu.sporny.org/#me> .
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0020.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-{
-  "@context": {
-    "xsd": "http://www.w3.org/2001/XMLSchema#",
-    "created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:date"}
-  },
-  "@id":  "http://greggkellogg.net/foaf#me",
-  "created":  "1957-02-27"
-}
--- a/test-suite/tests/rdf-0020.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-PREFIX dcterms: <http://purl.org/dc/terms/>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> dcterms:created "1957-02-27"^^xsd:date
-}
--- a/test-suite/tests/rdf-0021.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": { "measure": "http://example/measure#"},
-  "measure:cups": 5.3
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0021.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/measure#cups> "5.3"^^xsd:double
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0022.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": { "measure": "http://example/measure#"},
-  "measure:cups": 5.3e0
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0022.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/measure#cups> "5.3"^^xsd:double
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0023.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": { "chem": "http://example/chem#"},
-  "chem:protons": 12
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0023.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/chem#protons> "12"^^xsd:integer
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0024.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": { "sensor": "http://example/sensor#"},
-  "sensor:active": true
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0024.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/sensor#active> "true"^^xsd:boolean
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0025.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@container": "@list"}
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "knows": ["Manu Sporny"]
-}
--- a/test-suite/tests/rdf-0025.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ("Manu Sporny") .
-}
--- a/test-suite/tests/rdf-0026.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-{
-  "@context": {"rdfs": "http://www.w3.org/2000/01/rdf-schema#"},
-  "@type": ["rdfs:Resource", "rdfs:Class"]
-}
--- a/test-suite/tests/rdf-0026.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  [a rdfs:Resource, rdfs:Class]
-}
--- a/test-suite/tests/rdf-0027.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-{
-  "@context": {
-    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-    "ex": "http://example.org/",
-    "xsd": "http://www.w3.org/2001/XMLSchema#",
-    "ex:locatedIn": {"@type": "@id"},
-    "ex:hasPopulaton": {"@type": "xsd:integer"},
-    "ex:hasReference": {"@type": "@id"}
-  },
-  "@graph": [
-    {
-      "@id": "http://example.org/ParisFact1",
-      "@type": "rdf:Graph",
-      "@graph": {
-        "@id": "http://example.org/location/Paris#this",
-        "ex:locatedIn": "http://example.org/location/France#this"
-      },
-      "ex:hasReference": ["http://www.britannica.com/", "http://www.wikipedia.org/", "http://www.brockhaus.de/"]
-    },
-    {
-      "@id": "http://example.org/ParisFact2",
-      "@type": "rdf:Graph",
-      "@graph": {
-        "@id": "http://example.org/location/Paris#this",
-        "ex:hasPopulation": 7000000
-      },
-      "ex:hasReference": "http://www.wikipedia.org/"
-    }
-  ]
-}
--- a/test-suite/tests/rdf-0027.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-PREFIX ex: <http://example.org/> 
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK
-WHERE {
-  ex:ParisFact1 a rdf:Graph;
-    ex:hasReference <http://www.britannica.com/>,
-      <http://www.wikipedia.org/>,
-      <http://www.brockhaus.de/> .
-  ex:ParisFact2 a rdf:Graph;
-    ex:hasReference <http://www.wikipedia.org/> .
-  GRAPH ex:ParisFact1 {
-    <http://example.org/location/Paris#this> ex:locatedIn <http://example.org/location/France#this> .
-  }
-  GRAPH ex:ParisFact2 {
-    <http://example.org/location/Paris#this> ex:locatedIn <http://example.org/location/France#this> .
-  }
-}
--- a/test-suite/tests/rdf-0028.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "sec": "http://purl.org/security#",
-    "xsd": "http://www.w3.org/2001/XMLSchema#",
-    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-    "dc": "http://purl.org/dc/terms/",
-    "sec:signer": {"@type": "@id"},
-    "dc:created": {"@type": "xsd:dateTime"}
-  },
-  "@id": "http://example.org/sig1",
-  "@type": ["rdf:Graph", "sec:SignedGraph"],
-  "dc:created": "2011-09-23T20:21:34Z",
-  "sec:signer": "http://payswarm.example.com/i/john/keys/5",
-  "sec:signatureValue": "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI=",
-  "@graph": {
-    "@id": "http://example.org/fact1",
-    "dc:title": "Hello World!"
-  }
-}
\ No newline at end of file
--- a/test-suite/tests/rdf-0028.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-PREFIX dc: <http://purl.org/dc/terms/>
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-PREFIX sec: <http://purl.org/security#>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  <http://example.org/sig1> a rdf:Graph, sec:SignedGraph;
-    dc:created "2011-09-23T20:21:34Z"^^xsd:dateTime;
-    sec:signatureValue "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI=";
-    sec:signer <http://payswarm.example.com/i/john/keys/5> .
-  GRAPH <http://example.org/sig1> {
-    <http://example.org/fact1> dc:title "Hello World!" .
-  }
-}
--- a/test-suite/tests/rdf-0029.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-{
-  "@context": {
-    "wd": "http://data.wikipedia.org/vocab#",
-    "ws": "http://data.wikipedia.org/snaks/",
-    "wp": "http://en.wikipedia.org/wiki/"
-  },
-  "@id": "ws:Assertions",
-  "@type": "wd:SnakSet",
-  "@graph": {
-    "@id": "ws:BerlinFact",
-    "@type": "wd:Snak",
-    "@graph": {
-      "@id": "wp:Berlin",
-      "wd:population": 3499879
-    },
-    "wd:assertedBy": "http://www.statistik-berlin-brandenburg.de/"
-  }
-}
--- a/test-suite/tests/rdf-0029.sparql	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-PREFIX wd: <http://data.wikipedia.org/vocab#>
-PREFIX wp: <http://en.wikipedia.org/wiki/>
-PREFIX ws: <http://data.wikipedia.org/snaks/>
-
-ASK WHERE {
-  ws:Assertions a wd:SnakSet; .
-  GRAPH ws:Assertions {
-    ws:BerlinFact a wd:Snak;
-       wd:assertedBy "http://www.statistik-berlin-brandenburg.de/" .
-  }
-  GRAPH ws:BerlinFact {
-    wp:Berlin wd:population 3499879 .
-  }
-}
--- a/test-suite/tests/rdf-manifest.jsonld	Mon Apr 30 16:05:56 2012 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-{
-  "@context": "http://json-ld.org/test-suite/context.jsonld",
-  "@id": "",
-  "@type": "jld:Manifest",
-  "rdfs:comment": "JSON-LD to RDF tests use SPARQL queries to determine results",
-  "name": "rdf",
-  "sequence": [
-    {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0001.jsonld",
-      "name": "Plain literal with URIs",
-      "purpose": "Tests generation of a triple using full URIs and a plain literal.",
-      "sparql": "rdf-0001.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0002.jsonld",
-      "name": "Plain literal with CURIE from default context",
-      "purpose": "Tests generation of a triple using a CURIE defined in the default context.",
-      "sparql": "rdf-0002.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0003.jsonld",
-      "name": "Default subject is BNode",
-      "purpose": "Tests that a BNode is created if no explicit subject is set.",
-      "sparql": "rdf-0003.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0004.jsonld",
-      "name": "Literal with language tag",
-      "purpose": "Tests that a plain literal is created with a language tag.",
-      "sparql": "rdf-0004.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0005.jsonld",
-      "name": "Extended character set literal",
-      "purpose": "Tests that a literal may be created using extended characters.",
-      "sparql": "rdf-0005.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0006.jsonld",
-      "name": "Typed literal",
-      "purpose": "Tests creation of a literal with a datatype.",
-      "sparql": "rdf-0006.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0007.jsonld",
-      "name": "Tests 'a' generates rdf:type and object is implicit IRI",
-      "purpose": "Verify that 'a' is an alias for rdf:type, and the object is created as an IRI.",
-      "sparql": "rdf-0007.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0008.jsonld",
-      "name": "Test prefix defined in @context",
-      "purpose": "Generate an IRI using a prefix defined within an @context.",
-      "sparql": "rdf-0008.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0009.jsonld",
-      "name": "Test using default prefix",
-      "purpose": "The empty string may be used to define the default prefix.",
-      "sparql": "rdf-0009.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0010.jsonld",
-      "name": "Test object processing defines object",
-      "purpose": "A property referencing an associative array gets object from subject of array.",
-      "sparql": "rdf-0010.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0011.jsonld",
-      "name": "Test object processing defines object with implicit BNode",
-      "purpose": "If no @ is specified, a BNode is created, and will be used as the object of an enclosing property.",
-      "sparql": "rdf-0011.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0012.jsonld",
-      "name": "Multiple Objects for a Single Property",
-      "purpose": "Tests that Multiple Objects are for a Single Property using array syntax.",
-      "sparql": "rdf-0012.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0013.jsonld",
-      "name": "Creation of an empty list",
-      "purpose": "Tests that [[]] generates an empty list.",
-      "sparql": "rdf-0013.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0014.jsonld",
-      "name": "Creation of a list with single element",
-      "purpose": "Tests that [[a]] generates list.",
-      "sparql": "rdf-0014.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0015.jsonld",
-      "name": "Creation of a list with multiple elements",
-      "purpose": "Tests that list with multiple elements.",
-      "sparql": "rdf-0015.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0016.jsonld",
-      "name": "Empty IRI expands to resource location",
-      "purpose": "Expanding an empty IRI uses the test file location.",
-      "sparql": "rdf-0016.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0017.jsonld",
-      "name": "Relative IRI expands relative resource location",
-      "purpose": "Expanding a relative IRI uses the test file location.",
-      "sparql": "rdf-0017.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0018.jsonld",
-      "name": "Frag ID expands relative resource location",
-      "purpose": "Expanding a fragment uses the test file location.",
-      "sparql": "rdf-0018.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0019.jsonld",
-      "name": "Test type coercion to anyURI",
-      "purpose": "Tests coercion of object to anyURI when specified.",
-      "sparql": "rdf-0019.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0020.jsonld",
-      "name": "Test type coercion to typed literal",
-      "purpose": "Tests coercion of object to a typed literal when specified.",
-      "sparql": "rdf-0020.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0021.jsonld",
-      "name": "Test coercion of decimal value to double",
-      "purpose": "Tests that a decimal value generates a xsd:double typed literal.",
-      "sparql": "rdf-0021.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0022.jsonld",
-      "name": "Test coercion of double value",
-      "purpose": "Tests that a decimal value generates a xsd:double typed literal;.",
-      "sparql": "rdf-0022.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0023.jsonld",
-      "name": "Test coercion of integer value",
-      "purpose": "Tests that a decimal value generates a xsd:integer typed literal.",
-      "sparql": "rdf-0023.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0024.jsonld",
-      "name": "Test coercion of boolean value",
-      "purpose": "Tests that a decimal value generates a xsd:boolean typed literal.",
-      "sparql": "rdf-0024.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0025.jsonld",
-      "name": "Test list coercion with single element",
-      "purpose": "Tests that an array with a single element on a property with @list coercion creates an RDF Collection.",
-      "sparql": "rdf-0025.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0026.jsonld",
-      "name": "Test creation of multiple types",
-      "purpose": "Tests that @type with an array of types creates multiple types.",
-      "sparql": "rdf-0026.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0027.jsonld",
-      "name": "Simple named graph (Wikidata)",
-      "purpose": "Using @graph with other keys places triples in a named graph.",
-      "sparql": "rdf-0027.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0028.jsonld",
-      "name": "Simple named graph",
-      "purpose": "Signing a graph.",
-      "sparql": "rdf-0028.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "name": "named graph with embedded named graph",
-      "purpose": "Tests that named graphs containing named graphs flatten to single level of graph naming.",
-      "input": "rdf-0029.jsonld",
-      "sparql": "rdf-0029.sparql"
-    }
-  ]
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0001-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@id": "http://greggkellogg.net/foaf#me",
+  "http://xmlns.com/foaf/0.1/name": "Gregg Kellogg"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0001-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/name> "Gregg Kellogg" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0002-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,5 @@
+{
+  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
+  "@id": "http://greggkellogg.net/foaf#me",
+  "foaf:name": "Gregg Kellogg"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0002-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/name> "Gregg Kellogg" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0003-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
+  "@type": "foaf:Person"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0003-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0004-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,6 @@
+{
+  "http://www.w3.org/2000/01/rdf-schema#label": {
+    "@value": "A plain literal with a lang tag.",
+    "@language": "en-us"
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0004-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://www.w3.org/2000/01/rdf-schema#label> "A plain literal with a lang tag."@en-us .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0005-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,6 @@
+{
+  "@id": "http://greggkellogg.net/foaf#me",
+  "http://xmlns.com/foaf/0.1/knows": {
+    "http://xmlns.com/foaf/0.1/name": {"@value": "Herman Iván", "@language": "hu"}
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0005-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,2 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> _:t0 .
+_:t0 <http://xmlns.com/foaf/0.1/name> "Herman Iván"@hu .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0006-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,7 @@
+{
+  "@id":  "http://greggkellogg.net/foaf#me",
+  "http://purl.org/dc/terms/created":  {
+    "@value": "1957-02-27",
+    "@type": "http://www.w3.org/2001/XMLSchema#date"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0006-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://greggkellogg.net/foaf#me> <http://purl.org/dc/terms/created> "1957-02-27"^^<http://www.w3.org/2001/XMLSchema#date> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0007-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@id": "http://greggkellogg.net/foaf#me",
+  "@type": "http://xmlns.com/foaf/0.1/Person"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0007-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://greggkellogg.net/foaf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0008-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": {"d": "http://example.com/default#"},
+  "d:foo": "bar"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0008-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://example.com/default#foo> "bar" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0009-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": {"": "http://example.com/default#"},
+  ":foo": "bar"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0009-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://example.com/default#foo> "bar" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0010-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,8 @@
+{
+  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
+  "@id": "http://greggkellogg.net/foaf#me",
+  "foaf:knows": {
+    "@id": "http://manu.sporny.org/#me",
+    "foaf:name": "Manu Sporny"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0010-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,2 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> <http://manu.sporny.org/#me> .
+<http://manu.sporny.org/#me> <http://xmlns.com/foaf/0.1/name> "Manu Sporny" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0011-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,9 @@
+{
+  "@context": {
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@id": "http://greggkellogg.net/foaf#me",
+  "foaf:knows": {
+    "foaf:name": "Dave Longley"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0011-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,2 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> _:t0 .
+_:t0 <http://xmlns.com/foaf/0.1/name> "Dave Longley" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0012-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@id": "http://greggkellogg.net/foaf#me",
+  "foaf:knows": ["Manu Sporny", "Dave Longley"]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0012-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,2 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> "Dave Longley" .
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> "Manu Sporny" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0013-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@id": "http://greggkellogg.net/foaf#me",
+  "foaf:knows": {"@list": []}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0013-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0014-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@id": "http://greggkellogg.net/foaf#me",
+  "foaf:knows": {"@list": ["Manu Sporny"]}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0014-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,3 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> _:t0 .
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "Manu Sporny" .
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0015-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
+  "@id": "http://greggkellogg.net/foaf#me",
+  "foaf:knows": {"@list": ["Manu Sporny", "Dave Longley"]}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0015-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,5 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> _:t0 .
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "Manu Sporny" .
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:t1 .
+_:t1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "Dave Longley" .
+_:t1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0016-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@id": "",
+  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0016-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://json-ld.org/test-suite/tests/toRdf-0016-in.jsonld> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Resource> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0017-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@id": "a/b",
+  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0017-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://json-ld.org/test-suite/tests/a/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Resource> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0018-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@id": "#frag",
+  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0018-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://json-ld.org/test-suite/tests/toRdf-0018-in.jsonld#frag> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Resource> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0019-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,8 @@
+{
+  "@context": {
+    "foaf": "http://xmlns.com/foaf/0.1/",
+    "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id"}
+  },
+  "@id":    "http://greggkellogg.net/foaf#me",
+  "knows":  "http://manu.sporny.org/#me"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0019-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> <http://manu.sporny.org/#me> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0020-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,8 @@
+{
+  "@context": {
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:date"}
+  },
+  "@id":  "http://greggkellogg.net/foaf#me",
+  "created":  "1957-02-27"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0020-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+<http://greggkellogg.net/foaf#me> <http://purl.org/dc/terms/created> "1957-02-27"^^<http://www.w3.org/2001/XMLSchema#date> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0021-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": { "measure": "http://example/measure#"},
+  "measure:cups": 5.3
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0021-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://example/measure#cups> "5.300000000000000e+00"^^<http://www.w3.org/2001/XMLSchema#double> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0022-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": { "measure": "http://example/measure#"},
+  "measure:cups": 5.3e0
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0022-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://example/measure#cups> "5.300000000000000e+00"^^<http://www.w3.org/2001/XMLSchema#double> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0023-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": { "chem": "http://example/chem#"},
+  "chem:protons": 12
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0023-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://example/chem#protons> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0024-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": { "sensor": "http://example/sensor#"},
+  "sensor:active": true
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0024-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,1 @@
+_:t0 <http://example/sensor#active> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0025-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@container": "@list"}
+  },
+  "@id": "http://greggkellogg.net/foaf#me",
+  "knows": ["Manu Sporny"]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0025-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,3 @@
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> _:t0 .
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "Manu Sporny" .
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0026-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+{
+  "@context": {"rdfs": "http://www.w3.org/2000/01/rdf-schema#"},
+  "@type": ["rdfs:Resource", "rdfs:Class"]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0026-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,2 @@
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> .
+_:t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Resource> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0027-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,30 @@
+{
+  "@context": {
+    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+    "ex": "http://example.org/",
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "ex:locatedIn": {"@type": "@id"},
+    "ex:hasPopulaton": {"@type": "xsd:integer"},
+    "ex:hasReference": {"@type": "@id"}
+  },
+  "@graph": [
+    {
+      "@id": "http://example.org/ParisFact1",
+      "@type": "rdf:Graph",
+      "@graph": {
+        "@id": "http://example.org/location/Paris#this",
+        "ex:locatedIn": "http://example.org/location/France#this"
+      },
+      "ex:hasReference": ["http://www.britannica.com/", "http://www.wikipedia.org/", "http://www.brockhaus.de/"]
+    },
+    {
+      "@id": "http://example.org/ParisFact2",
+      "@type": "rdf:Graph",
+      "@graph": {
+        "@id": "http://example.org/location/Paris#this",
+        "ex:hasPopulation": 7000000
+      },
+      "ex:hasReference": "http://www.wikipedia.org/"
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0027-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,8 @@
+<http://example.org/ParisFact1> <http://example.org/hasReference> <http://www.britannica.com/> .
+<http://example.org/ParisFact1> <http://example.org/hasReference> <http://www.brockhaus.de/> .
+<http://example.org/ParisFact1> <http://example.org/hasReference> <http://www.wikipedia.org/> .
+<http://example.org/ParisFact1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Graph> .
+<http://example.org/ParisFact2> <http://example.org/hasReference> <http://www.wikipedia.org/> .
+<http://example.org/ParisFact2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Graph> .
+<http://example.org/location/Paris#this> <http://example.org/hasPopulation> "7000000"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/ParisFact2> .
+<http://example.org/location/Paris#this> <http://example.org/locatedIn> <http://example.org/location/France#this> <http://example.org/ParisFact1> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0028-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,19 @@
+{
+  "@context": {
+    "sec": "http://purl.org/security#",
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+    "dc": "http://purl.org/dc/terms/",
+    "sec:signer": {"@type": "@id"},
+    "dc:created": {"@type": "xsd:dateTime"}
+  },
+  "@id": "http://example.org/sig1",
+  "@type": ["rdf:Graph", "sec:SignedGraph"],
+  "dc:created": "2011-09-23T20:21:34Z",
+  "sec:signer": "http://payswarm.example.com/i/john/keys/5",
+  "sec:signatureValue": "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI=",
+  "@graph": {
+    "@id": "http://example.org/fact1",
+    "dc:title": "Hello World!"
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0028-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,6 @@
+<http://example.org/fact1> <http://purl.org/dc/terms/title> "Hello World!" <http://example.org/sig1> .
+<http://example.org/sig1> <http://purl.org/dc/terms/created> "2011-09-23T20:21:34Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://example.org/sig1> <http://purl.org/security#signatureValue> "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI=" .
+<http://example.org/sig1> <http://purl.org/security#signer> <http://payswarm.example.com/i/john/keys/5> .
+<http://example.org/sig1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/security#SignedGraph> .
+<http://example.org/sig1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Graph> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0029-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,18 @@
+{
+  "@context": {
+    "wd": "http://data.wikipedia.org/vocab#",
+    "ws": "http://data.wikipedia.org/snaks/",
+    "wp": "http://en.wikipedia.org/wiki/"
+  },
+  "@id": "ws:Assertions",
+  "@type": "wd:SnakSet",
+  "@graph": {
+    "@id": "ws:BerlinFact",
+    "@type": "wd:Snak",
+    "@graph": {
+      "@id": "wp:Berlin",
+      "wd:population": 3499879
+    },
+    "wd:assertedBy": "http://www.statistik-berlin-brandenburg.de/"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0029-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,4 @@
+<http://data.wikipedia.org/snaks/Assertions> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://data.wikipedia.org/vocab#SnakSet> .
+<http://data.wikipedia.org/snaks/BerlinFact> <http://data.wikipedia.org/vocab#assertedBy> "http://www.statistik-berlin-brandenburg.de/" <http://data.wikipedia.org/snaks/Assertions> .
+<http://data.wikipedia.org/snaks/BerlinFact> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://data.wikipedia.org/vocab#Snak> <http://data.wikipedia.org/snaks/Assertions> .
+<http://en.wikipedia.org/wiki/Berlin> <http://data.wikipedia.org/vocab#population> "3499879"^^<http://www.w3.org/2001/XMLSchema#integer> <http://data.wikipedia.org/snaks/BerlinFact> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0030-in.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,26 @@
+{
+  "@context": {
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "knows": "http://xmlns.com/foaf/0.1/knows",
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "asOf": "http://example.org/asOf"
+  },
+  "@id": "http://example.org/linked-data-graph",
+  "asOf": {"@value": "2012-04-09", "@type": "xsd:date"},
+  "@graph":
+  [
+    {
+      "@id": "http://manu.sporny.org/i/public",
+      "@type": "foaf:Person",
+      "name": "Manu Sporny",
+      "knows": "http://greggkellogg.net/foaf#me"
+    },
+    {
+      "@id": "http://greggkellogg.net/foaf#me",
+      "@type": "foaf:Person",
+      "name": "Gregg Kellogg",
+      "knows": "http://manu.sporny.org/i/public"
+    },
+    "http://www.markus-lanthaler.com/"
+  ]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0030-out.nq	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,7 @@
+<http://example.org/linked-data-graph> <http://example.org/asOf> "2012-04-09"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://greggkellogg.net/foaf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <foaf:Person> <http://example.org/linked-data-graph> .
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/knows> "http://manu.sporny.org/i/public" <http://example.org/linked-data-graph> .
+<http://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/name> "Gregg Kellogg" <http://example.org/linked-data-graph> .
+<http://manu.sporny.org/i/public> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <foaf:Person> <http://example.org/linked-data-graph> .
+<http://manu.sporny.org/i/public> <http://xmlns.com/foaf/0.1/knows> "http://greggkellogg.net/foaf#me" <http://example.org/linked-data-graph> .
+<http://manu.sporny.org/i/public> <http://xmlns.com/foaf/0.1/name> "Manu Sporny" <http://example.org/linked-data-graph> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-manifest.jsonld	Tue May 01 21:42:49 2012 +0800
@@ -0,0 +1,190 @@
+{
+  "@context": "http://json-ld.org/test-suite/context.jsonld",
+  "@id": "",
+  "@type": "jld:Manifest",
+  "rdfs:comment": "JSON-LD to RDF tests generate N-Quads Output",
+  "name": "toRdf",
+  "sequence": [
+    {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Plain literal with URIs",
+      "purpose": "Tests generation of a triple using full URIs and a plain literal.",
+      "input": "toRdf-0001-in.jsonld",
+      "expect": "toRdf-0001-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Plain literal with CURIE from default context",
+      "purpose": "Tests generation of a triple using a CURIE defined in the default context.",
+      "input": "toRdf-0002-in.jsonld",
+      "expect": "toRdf-0002-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Default subject is BNode",
+      "purpose": "Tests that a BNode is created if no explicit subject is set.",
+      "input": "toRdf-0003-in.jsonld",
+      "expect": "toRdf-0003-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Literal with language tag",
+      "purpose": "Tests that a plain literal is created with a language tag.",
+      "input": "toRdf-0004-in.jsonld",
+      "expect": "toRdf-0004-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Extended character set literal",
+      "purpose": "Tests that a literal may be created using extended characters.",
+      "input": "toRdf-0005-in.jsonld",
+      "expect": "toRdf-0005-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Typed literal",
+      "purpose": "Tests creation of a literal with a datatype.",
+      "input": "toRdf-0006-in.jsonld",
+      "expect": "toRdf-0006-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Tests 'a' generates rdf:type and object is implicit IRI",
+      "purpose": "Verify that 'a' is an alias for rdf:type, and the object is created as an IRI.",
+      "input": "toRdf-0007-in.jsonld",
+      "expect": "toRdf-0007-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test prefix defined in @context",
+      "purpose": "Generate an IRI using a prefix defined within an @context.",
+      "input": "toRdf-0008-in.jsonld",
+      "expect": "toRdf-0008-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test using default prefix",
+      "purpose": "The empty string may be used to define the default prefix.",
+      "input": "toRdf-0009-in.jsonld",
+      "expect": "toRdf-0009-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test object processing defines object",
+      "purpose": "A property referencing an associative array gets object from subject of array.",
+      "input": "toRdf-0010-in.jsonld",
+      "expect": "toRdf-0010-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test object processing defines object with implicit BNode",
+      "purpose": "If no @ is specified, a BNode is created, and will be used as the object of an enclosing property.",
+      "input": "toRdf-0011-in.jsonld",
+      "expect": "toRdf-0011-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Multiple Objects for a Single Property",
+      "purpose": "Tests that Multiple Objects are for a Single Property using array syntax.",
+      "input": "toRdf-0012-in.jsonld",
+      "expect": "toRdf-0012-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Creation of an empty list",
+      "purpose": "Tests that [[]] generates an empty list.",
+      "input": "toRdf-0013-in.jsonld",
+      "expect": "toRdf-0013-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Creation of a list with single element",
+      "purpose": "Tests that [[a]] generates list.",
+      "input": "toRdf-0014-in.jsonld",
+      "expect": "toRdf-0014-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Creation of a list with multiple elements",
+      "purpose": "Tests that list with multiple elements.",
+      "input": "toRdf-0015-in.jsonld",
+      "expect": "toRdf-0015-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Empty IRI expands to resource location",
+      "purpose": "Expanding an empty IRI uses the test file location.",
+      "input": "toRdf-0016-in.jsonld",
+      "expect": "toRdf-0016-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Relative IRI expands relative resource location",
+      "purpose": "Expanding a relative IRI uses the test file location.",
+      "input": "toRdf-0017-in.jsonld",
+      "expect": "toRdf-0017-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Frag ID expands relative resource location",
+      "purpose": "Expanding a fragment uses the test file location.",
+      "input": "toRdf-0018-in.jsonld",
+      "expect": "toRdf-0018-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test type coercion to anyURI",
+      "purpose": "Tests coercion of object to anyURI when specified.",
+      "input": "toRdf-0019-in.jsonld",
+      "expect": "toRdf-0019-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test type coercion to typed literal",
+      "purpose": "Tests coercion of object to a typed literal when specified.",
+      "input": "toRdf-0020-in.jsonld",
+      "expect": "toRdf-0020-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test coercion of decimal value to double",
+      "purpose": "Tests that a decimal value generates a xsd:double typed literal.",
+      "input": "toRdf-0021-in.jsonld",
+      "expect": "toRdf-0021-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test coercion of double value",
+      "purpose": "Tests that a decimal value generates a xsd:double typed literal;.",
+      "input": "toRdf-0022-in.jsonld",
+      "expect": "toRdf-0022-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test coercion of integer value",
+      "purpose": "Tests that a decimal value generates a xsd:integer typed literal.",
+      "input": "toRdf-0023-in.jsonld",
+      "expect": "toRdf-0023-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test coercion of boolean value",
+      "purpose": "Tests that a decimal value generates a xsd:boolean typed literal.",
+      "input": "toRdf-0024-in.jsonld",
+      "expect": "toRdf-0024-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test list coercion with single element",
+      "purpose": "Tests that an array with a single element on a property with @list coercion creates an RDF Collection.",
+      "input": "toRdf-0025-in.jsonld",
+      "expect": "toRdf-0025-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Test creation of multiple types",
+      "purpose": "Tests that @type with an array of types creates multiple types.",
+      "input": "toRdf-0026-in.jsonld",
+      "expect": "toRdf-0026-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Simple named graph (Wikidata)",
+      "purpose": "Using @graph with other keys places triples in a named graph.",
+      "input": "toRdf-0027-in.jsonld",
+      "expect": "toRdf-0027-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "Simple named graph",
+      "purpose": "Signing a graph.",
+      "input": "toRdf-0028-in.jsonld",
+      "expect": "toRdf-0028-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "named graph with embedded named graph",
+      "purpose": "Tests that named graphs containing named graphs flatten to single level of graph naming.",
+      "input": "toRdf-0029-in.jsonld",
+      "expect": "toRdf-0029-out.nq"
+    }, {
+      "@type": ["test:TestCase", "jld:ToRDFTest"],
+      "name": "top-level graph with string subject reference",
+      "purpose": "Tests graphs containing subject references as strings.",
+      "input": "toRdf-0030-in.jsonld",
+      "expect": "toRdf-0030-out.nq"
+    }    
+  ]
+}