Add tests for flattening
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 13 Dec 2012 18:37:27 +0100
changeset 1035 17f0ba1e50a0
parent 1034 9969321afca0
child 1036 db21172b1b0f
Add tests for flattening

This addresses #109.
test-suite/manifest.jsonld
test-suite/tests/flatten-0001-in.jsonld
test-suite/tests/flatten-0001-out.jsonld
test-suite/tests/flatten-0002-in.jsonld
test-suite/tests/flatten-0002-out.jsonld
test-suite/tests/flatten-0003-in.jsonld
test-suite/tests/flatten-0003-out.jsonld
test-suite/tests/flatten-0004-in.jsonld
test-suite/tests/flatten-0004-out.jsonld
test-suite/tests/flatten-0005-in.jsonld
test-suite/tests/flatten-0005-out.jsonld
test-suite/tests/flatten-0006-in.jsonld
test-suite/tests/flatten-0006-out.jsonld
test-suite/tests/flatten-0007-in.jsonld
test-suite/tests/flatten-0007-out.jsonld
test-suite/tests/flatten-0008-in.jsonld
test-suite/tests/flatten-0008-out.jsonld
test-suite/tests/flatten-0009-in.jsonld
test-suite/tests/flatten-0009-out.jsonld
test-suite/tests/flatten-0010-in.jsonld
test-suite/tests/flatten-0010-out.jsonld
test-suite/tests/flatten-0011-in.jsonld
test-suite/tests/flatten-0011-out.jsonld
test-suite/tests/flatten-0012-in.jsonld
test-suite/tests/flatten-0012-out.jsonld
test-suite/tests/flatten-0013-in.jsonld
test-suite/tests/flatten-0013-out.jsonld
test-suite/tests/flatten-0014-in.jsonld
test-suite/tests/flatten-0014-out.jsonld
test-suite/tests/flatten-0015-in.jsonld
test-suite/tests/flatten-0015-out.jsonld
test-suite/tests/flatten-0016-in.jsonld
test-suite/tests/flatten-0016-out.jsonld
test-suite/tests/flatten-0017-in.jsonld
test-suite/tests/flatten-0017-out.jsonld
test-suite/tests/flatten-0018-in.jsonld
test-suite/tests/flatten-0018-out.jsonld
test-suite/tests/flatten-0019-in.jsonld
test-suite/tests/flatten-0019-out.jsonld
test-suite/tests/flatten-0020-in.jsonld
test-suite/tests/flatten-0020-out.jsonld
test-suite/tests/flatten-0021-in.jsonld
test-suite/tests/flatten-0021-out.jsonld
test-suite/tests/flatten-0022-in.jsonld
test-suite/tests/flatten-0022-out.jsonld
test-suite/tests/flatten-0023-in.jsonld
test-suite/tests/flatten-0023-out.jsonld
test-suite/tests/flatten-0024-in.jsonld
test-suite/tests/flatten-0024-out.jsonld
test-suite/tests/flatten-0025-in.jsonld
test-suite/tests/flatten-0025-out.jsonld
test-suite/tests/flatten-0026-in.jsonld
test-suite/tests/flatten-0026-out.jsonld
test-suite/tests/flatten-0027-in.jsonld
test-suite/tests/flatten-0027-out.jsonld
test-suite/tests/flatten-0028-in.jsonld
test-suite/tests/flatten-0028-out.jsonld
test-suite/tests/flatten-0029-in.jsonld
test-suite/tests/flatten-0029-out.jsonld
test-suite/tests/flatten-0030-in.jsonld
test-suite/tests/flatten-0030-out.jsonld
test-suite/tests/flatten-0031-in.jsonld
test-suite/tests/flatten-0031-out.jsonld
test-suite/tests/flatten-0032-in.jsonld
test-suite/tests/flatten-0032-out.jsonld
test-suite/tests/flatten-0033-in.jsonld
test-suite/tests/flatten-0033-out.jsonld
test-suite/tests/flatten-0034-in.jsonld
test-suite/tests/flatten-0034-out.jsonld
test-suite/tests/flatten-0035-in.jsonld
test-suite/tests/flatten-0035-out.jsonld
test-suite/tests/flatten-0036-in.jsonld
test-suite/tests/flatten-0036-out.jsonld
test-suite/tests/flatten-0037-in.jsonld
test-suite/tests/flatten-0037-out.jsonld
test-suite/tests/flatten-0038-in.jsonld
test-suite/tests/flatten-0038-out.jsonld
test-suite/tests/flatten-0039-in.jsonld
test-suite/tests/flatten-0039-out.jsonld
test-suite/tests/flatten-0040-in.jsonld
test-suite/tests/flatten-0040-out.jsonld
test-suite/tests/flatten-manifest.jsonld
--- a/test-suite/manifest.jsonld	Thu Dec 13 14:06:43 2012 +0100
+++ b/test-suite/manifest.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -5,11 +5,12 @@
   "rdfs:comment": "This manifest loads additional manifests for specific behavior tests",
   "name": "JSON-LD Test Suite",
   "sequence": [
+    "tests/expand-manifest.jsonld",
     "tests/compact-manifest.jsonld",
-    "tests/expand-manifest.jsonld",
+    "tests/flatten-manifest.jsonld",
     "tests/frame-manifest.jsonld",
     "tests/fromRdf-manifest.jsonld",
+    "tests/toRdf-manifest.jsonld"
     "tests/normalize-manifest.jsonld",
-    "tests/toRdf-manifest.jsonld"
   ]
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0001-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,1 @@
+{"@id": "http://example.org/test#example"}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0001-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,5 @@
+[
+    {
+        "@id": "http://example.org/test#example"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0002-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,19 @@
+{
+  "@context": {
+    "id1": "http://example.com/id1",
+    "t1": "http://example.com/t1",
+    "t2": "http://example.com/t2",
+    "term1": "http://example.com/term1",
+    "term2": "http://example.com/term2",
+    "term3": "http://example.com/term3",
+    "term4": "http://example.com/term4",
+    "term5": "http://example.com/term5"
+  },
+  "@id": "id1",
+  "@type": "t1",
+  "term1": "v1",
+  "term2": {"@value": "v2", "@type": "t2"},
+  "term3": {"@value": "v3", "@language": "en"},
+  "term4": 4,
+  "term5": [50, 51]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0002-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,38 @@
+[
+    {
+        "@id": "http://example.com/id1",
+        "@type": [
+            "http://example.com/t1"
+        ],
+        "http://example.com/term1": [
+            {
+                "@value": "v1"
+            }
+        ],
+        "http://example.com/term2": [
+            {
+                "@type": "http://example.com/t2",
+                "@value": "v2"
+            }
+        ],
+        "http://example.com/term3": [
+            {
+                "@language": "en",
+                "@value": "v3"
+            }
+        ],
+        "http://example.com/term4": [
+            {
+                "@value": 4
+            }
+        ],
+        "http://example.com/term5": [
+            {
+                "@value": 50
+            },
+            {
+                "@value": 51
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0003-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,12 @@
+{
+  "@id": "http://example.org/id",
+  "http://example.org/property": null,
+  "regularJson": {
+    "nonJsonLd": "property",
+    "deep": [{
+      "foo": "bar"
+    }, {
+      "bar": "foo"
+    }]
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0003-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,5 @@
+[
+    {
+        "@id": "http://example.org/id"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0004-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,21 @@
+{
+  "@context": {
+    "mylist1": {"@id": "http://example.com/mylist1", "@container": "@list"},
+    "mylist2": {"@id": "http://example.com/mylist2", "@container": "@list"},
+    "myset2": {"@id": "http://example.com/myset2", "@container": "@set"},
+    "myset3": {"@id": "http://example.com/myset3", "@container": "@set"}
+  },
+  "@id": "http://example.org/id",
+  "mylist1": { "@list": [ ] },
+  "mylist2": "one item",
+  "myset2": { "@set": [ ] },
+  "myset3": [ "v1" ],
+  "http://example.org/list1": { "@list": [ null ] },
+  "http://example.org/list2": { "@list": [ {"@value": null} ] },
+  "http://example.org/set1": { "@set": [ ] },
+  "http://example.org/set1": { "@set": [ null ] },
+  "http://example.org/set3": [ ],
+  "http://example.org/set4": [ null ],
+  "http://example.org/set5": "one item",
+  "http://example.org/property": { "@list": "one item" }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0004-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,66 @@
+[
+    {
+        "@id": "http://example.org/id",
+        "http://example.com/mylist1": [
+            {
+                "@list": [
+
+                ]
+            }
+        ],
+        "http://example.com/mylist2": [
+            {
+                "@list": [
+                    {
+                        "@value": "one item"
+                    }
+                ]
+            }
+        ],
+        "http://example.com/myset2": [
+
+        ],
+        "http://example.com/myset3": [
+            {
+                "@value": "v1"
+            }
+        ],
+        "http://example.org/list1": [
+            {
+                "@list": [
+
+                ]
+            }
+        ],
+        "http://example.org/list2": [
+            {
+                "@list": [
+
+                ]
+            }
+        ],
+        "http://example.org/property": [
+            {
+                "@list": [
+                    {
+                        "@value": "one item"
+                    }
+                ]
+            }
+        ],
+        "http://example.org/set1": [
+
+        ],
+        "http://example.org/set3": [
+
+        ],
+        "http://example.org/set4": [
+
+        ],
+        "http://example.org/set5": [
+            {
+                "@value": "one item"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0005-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,23 @@
+{
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "homepage": {
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
+    },
+    "know": "http://xmlns.com/foaf/0.1/knows",
+    "@iri": "@id"
+  },
+  "@id": "#me",
+  "know": [
+    {
+      "@id": "http://example.com/bob#me",
+      "name": "Bob",
+      "homepage": "http://example.com/bob"
+    }, {
+      "@id": "http://example.com/alice#me",
+      "name": "Alice",
+      "homepage": "http://example.com/alice"
+    }
+  ]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0005-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,45 @@
+[
+    {
+        "@id": "http://json-ld.org/test-suite/tests/flatten-0005-in.jsonld#me",
+        "http://xmlns.com/foaf/0.1/knows": [
+            {
+                "@id": "http://example.com/bob#me"
+            },
+            {
+                "@id": "http://example.com/alice#me"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.com/bob#me",
+        "http://xmlns.com/foaf/0.1/homepage": [
+            {
+                "@id": "http://example.com/bob"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Bob"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.com/bob"
+    },
+    {
+        "@id": "http://example.com/alice#me",
+        "http://xmlns.com/foaf/0.1/homepage": [
+            {
+                "@id": "http://example.com/alice"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Alice"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.com/alice"
+    }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0006-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,20 @@
+{
+  "@context": {
+    "http://example.org/test#property1": {
+      "@type": "@id"
+    },
+    "http://example.org/test#property2": {
+      "@type": "@id"
+    },
+    "uri": "@id"
+  },
+  "http://example.org/test#property1": {
+    "http://example.org/test#property4": "foo",
+    "uri": "http://example.org/test#example2"
+  },
+  "http://example.org/test#property2": "http://example.org/test#example3",
+  "http://example.org/test#property3": {
+    "uri": "http://example.org/test#example4"
+  },
+  "uri": "http://example.org/test#example1"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0006-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,34 @@
+[
+    {
+        "@id": "http://example.org/test#example1",
+        "http://example.org/test#property1": [
+            {
+                "@id": "http://example.org/test#example2"
+            }
+        ],
+        "http://example.org/test#property2": [
+            {
+                "@id": "http://example.org/test#example3"
+            }
+        ],
+        "http://example.org/test#property3": [
+            {
+                "@id": "http://example.org/test#example4"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#example2",
+        "http://example.org/test#property4": [
+            {
+                "@value": "foo"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#example3"
+    },
+    {
+        "@id": "http://example.org/test#example4"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0007-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,18 @@
+{
+  "@context": {
+    "ex": "http://example.org/vocab#",
+    "ex:date": {
+      "@type": "xsd:dateTime"
+    },
+    "ex:parent": {
+      "@type": "@id"
+    },
+    "xsd": "http://www.w3.org/2001/XMLSchema#"
+  },
+  "@id": "http://example.org/test#example1",
+  "ex:date": "2011-01-25T00:00:00Z",
+  "ex:embed": {
+    "@id": "http://example.org/test#example2",
+    "ex:parent": "http://example.org/test#example1"
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0007-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,24 @@
+[
+    {
+        "@id": "http://example.org/test#example1",
+        "http://example.org/vocab#date": [
+            {
+                "@value": "2011-01-25T00:00:00Z",
+                "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
+            }
+        ],
+        "http://example.org/vocab#embed": [
+            {
+                "@id": "http://example.org/test#example2"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#example2",
+        "http://example.org/vocab#parent": [
+            {
+                "@id": "http://example.org/test#example1"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0008-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,9 @@
+{
+  "@context": {
+    "ex": "http://example.org/vocab#"
+  },
+  "@id": "http://example.org/test",
+  "ex:test": { "@value": "test",  "@language": "en" },
+  "ex:drop-lang-only": { "@language": "en" },
+  "ex:keep-full-value": { "@value": "only value" }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0008-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,16 @@
+[
+    {
+        "@id": "http://example.org/test",
+        "http://example.org/vocab#keep-full-value": [
+            {
+                "@value": "only value"
+            }
+        ],
+        "http://example.org/vocab#test": [
+            {
+                "@language": "en",
+                "@value": "test"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0009-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,43 @@
+{
+  "@context": {
+    "authored": {
+      "@id": "http://example.org/vocab#authored",
+      "@type": "@id"
+    },
+    "contains": {
+      "@id": "http://example.org/vocab#contains",
+      "@type": "@id"
+    },
+    "contributor": "http://purl.org/dc/elements/1.1/contributor",
+    "description": "http://purl.org/dc/elements/1.1/description",
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "title": {
+      "@id": "http://purl.org/dc/elements/1.1/title"
+    }
+  },
+  "@graph": [
+    {
+      "@id": "http://example.org/test#chapter",
+      "description": "Fun",
+      "title": "Chapter One"
+    },
+    {
+      "@id": "http://example.org/test#jane",
+      "authored": "http://example.org/test#chapter",
+      "name": "Jane"
+    },
+    {
+      "@id": "http://example.org/test#john",
+      "name": "John"
+    },
+    {
+      "@id": "http://example.org/test#library",
+      "contains": {
+        "@id": "http://example.org/test#book",
+        "contains": "http://example.org/test#chapter",
+        "contributor": "Writer",
+        "title": "My Book"
+      }
+    }
+  ]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0009-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,62 @@
+[
+    {
+        "@id": "http://example.org/test#chapter",
+        "http://purl.org/dc/elements/1.1/description": [
+            {
+                "@value": "Fun"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "Chapter One"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#jane",
+        "http://example.org/vocab#authored": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Jane"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#john",
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "John"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#library",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#book"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#book",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/contributor": [
+            {
+                "@value": "Writer"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "My Book"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0010-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,11 @@
+{
+  "@context": {
+    "d": "http://purl.org/dc/elements/1.1/",
+    "e": "http://example.org/vocab#",
+    "f": "http://xmlns.com/foaf/0.1/",
+    "xsd": "http://www.w3.org/2001/XMLSchema#"
+  },
+  "@id": "http://example.org/test",
+  "e:bool": true,
+  "e:int": 123
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0010-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,15 @@
+[
+    {
+        "@id": "http://example.org/test",
+        "http://example.org/vocab#bool": [
+            {
+                "@value": true
+            }
+        ],
+        "http://example.org/vocab#int": [
+            {
+                "@value": 123
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0011-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,13 @@
+{
+  "@context": {
+    "dc": "http://purl.org/dc/elements/1.1/",
+    "ex": "http://example.org/vocab#",
+    "ex:contains": {
+      "@type": "@id"
+    },
+    "xsd": "http://www.w3.org/2001/XMLSchema#"
+  },
+  "@id": "http://example.org/test#book",
+  "dc:title": "Title",
+  "ex:contains": "http://example.org/test#chapter"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0011-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,18 @@
+[
+    {
+        "@id": "http://example.org/test#book",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "Title"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#chapter"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0012-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,39 @@
+{
+  "@context": {
+    "dc": "http://purl.org/dc/elements/1.1/",
+    "ex": "http://example.org/vocab#",
+    "ex:authored": {
+      "@type": "@id"
+    },
+    "ex:contains": {
+      "@type": "@id"
+    },
+    "foaf": "http://xmlns.com/foaf/0.1/",
+    "xsd": "http://www.w3.org/2001/XMLSchema#"
+  },
+  "@graph": [
+    {
+      "@id": "http://example.org/test#chapter",
+      "dc:description": "Fun",
+      "dc:title": "Chapter One"
+    },
+    {
+      "@id": "http://example.org/test#jane",
+      "ex:authored": "http://example.org/test#chapter",
+      "foaf:name": "Jane"
+    },
+    {
+      "@id": "http://example.org/test#john",
+      "foaf:name": "John"
+    },
+    {
+      "@id": "http://example.org/test#library",
+      "ex:contains": {
+        "@id": "http://example.org/test#book",
+        "dc:contributor": "Writer",
+        "dc:title": "My Book",
+        "ex:contains": "http://example.org/test#chapter"
+      }
+    }
+  ]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0012-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,62 @@
+[
+    {
+        "@id": "http://example.org/test#chapter",
+        "http://purl.org/dc/elements/1.1/description": [
+            {
+                "@value": "Fun"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "Chapter One"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#jane",
+        "http://example.org/vocab#authored": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Jane"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#john",
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "John"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#library",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#book"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#book",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/contributor": [
+            {
+                "@value": "Writer"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "My Book"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0013-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,9 @@
+[{
+  "@id": "http://example.com/id1",
+  "@type": ["http://example.com/t1"],
+  "http://example.com/term1": ["v1"],
+  "http://example.com/term2": [{"@value": "v2", "@type": "http://example.com/t2"}],
+  "http://example.com/term3": [{"@value": "v3", "@language": "en"}],
+  "http://example.com/term4": [4],
+  "http://example.com/term5": [50, 51]
+}]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0013-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,38 @@
+[
+    {
+        "@id": "http://example.com/id1",
+        "@type": [
+            "http://example.com/t1"
+        ],
+        "http://example.com/term1": [
+            {
+                "@value": "v1"
+            }
+        ],
+        "http://example.com/term2": [
+            {
+                "@type": "http://example.com/t2",
+                "@value": "v2"
+            }
+        ],
+        "http://example.com/term3": [
+            {
+                "@language": "en",
+                "@value": "v3"
+            }
+        ],
+        "http://example.com/term4": [
+            {
+                "@value": 4
+            }
+        ],
+        "http://example.com/term5": [
+            {
+                "@value": 50
+            },
+            {
+                "@value": 51
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0014-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,50 @@
+{
+  "@context": {
+    "ex": "http://example.org/test#",
+    "property1": {
+      "@id": "http://example.org/test#property1",
+      "@type": "@id"
+    },
+    "property2": {
+      "@id": "ex:property2",
+      "@type": "@id"
+    },
+    "uri": "@id",
+    "set": "@set",
+    "value": "@value",
+    "type": "@type",
+    "xsd": { "@id": "http://www.w3.org/2001/XMLSchema#" }
+  },
+  "property1": {
+    "uri": "ex:example2",
+    "http://example.org/test#property4": "foo"
+  },
+  "property2": "http://example.org/test#example3",
+  "http://example.org/test#property3": {
+    "uri": "http://example.org/test#example4"
+  },
+  "ex:property4": {
+    "uri": "ex:example4",
+    "ex:property5": [
+      {
+        "set": [
+          {
+          "value": "2012-03-31",
+          "type": "xsd:date"
+          }
+        ]
+      }
+    ]
+  },
+  "ex:property6": [
+    {
+      "set": [
+        {
+        "value": null,
+        "type": "xsd:date"
+        }
+      ]
+    }
+  ],
+  "uri": "http://example.org/test#example1"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0014-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,48 @@
+[
+    {
+        "@id": "http://example.org/test#example1",
+        "http://example.org/test#property1": [
+            {
+                "@id": "http://example.org/test#example2"
+            }
+        ],
+        "http://example.org/test#property2": [
+            {
+                "@id": "http://example.org/test#example3"
+            }
+        ],
+        "http://example.org/test#property3": [
+            {
+                "@id": "http://example.org/test#example4"
+            }
+        ],
+        "http://example.org/test#property4": [
+            {
+                "@id": "http://example.org/test#example4"
+            }
+        ],
+        "http://example.org/test#property6": [
+
+        ]
+    },
+    {
+        "@id": "http://example.org/test#example2",
+        "http://example.org/test#property4": [
+            {
+                "@value": "foo"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#example3"
+    },
+    {
+        "@id": "http://example.org/test#example4",
+        "http://example.org/test#property5": [
+            {
+                "@type": "http://www.w3.org/2001/XMLSchema#date",
+                "@value": "2012-03-31"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0015-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "mylist1": {"@id": "http://example.com/mylist1", "@container": "@list"},
+    "mylist2": {"@id": "http://example.com/mylist2", "@container": "@list"},
+    "myset1": {"@id": "http://example.com/myset1", "@container": "@set" },
+    "myset2": {"@id": "http://example.com/myset2", "@container": "@set" },
+    "myset3": {"@id": "http://example.com/myset3", "@container": "@set" }
+  },
+  "@id": "http://example.org/id",
+  "mylist1": [],
+  "myset1": { "@set": [] },
+  "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ],
+  "myset3": [ { "@set": [ "hello", "this" ] }, "will", { "@set": [ "be", "collapsed" ] } ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0015-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,35 @@
+[
+    {
+        "@id": "http://example.org/id",
+        "http://example.com/mylist1": [
+            {
+                "@list": [
+
+                ]
+            }
+        ],
+        "http://example.com/myset1": [
+
+        ],
+        "http://example.com/myset2": [
+
+        ],
+        "http://example.com/myset3": [
+            {
+                "@value": "hello"
+            },
+            {
+                "@value": "this"
+            },
+            {
+                "@value": "will"
+            },
+            {
+                "@value": "be"
+            },
+            {
+                "@value": "collapsed"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0016-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,30 @@
+{
+  "@context": {
+    "myproperty": { "@id": "http://example.com/myproperty" },
+    "mylist1": {"@id": "http://example.com/mylist1", "@container": "@list"},
+    "mylist2": {"@id": "http://example.com/mylist2", "@container": "@list"},
+    "myset1": {"@id": "http://example.com/myset1", "@container": "@set" },
+    "myset2": {"@id": "http://example.com/myset2", "@container": "@set" }
+  },
+  "@id": "http://example.org/id1",
+  "mylist1": [],
+  "mylist2": [ 2, "hi" ],
+  "myset1": { "@set": [] },
+  "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ],
+  "myproperty": {
+    "@context": null,
+    "@id": "http://example.org/id2",
+    "mylist1": [],
+    "mylist2": [ 2, "hi" ],
+    "myset1": { "@set": [] },
+    "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ],
+    "http://example.org/myproperty2": "ok"
+  },
+  "http://example.com/emptyobj": {
+    "@context": null,
+    "mylist1": [],
+    "mylist2": [ 2, "hi" ],
+    "myset1": { "@set": [] },
+    "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ]
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0016-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,51 @@
+[
+    {
+        "@id": "http://example.org/id1",
+        "http://example.com/emptyobj": [
+            {
+                "@id": "_:t0"
+            }
+        ],
+        "http://example.com/mylist1": [
+            {
+                "@list": [
+
+                ]
+            }
+        ],
+        "http://example.com/mylist2": [
+            {
+                "@list": [
+                    {
+                        "@value": 2
+                    },
+                    {
+                        "@value": "hi"
+                    }
+                ]
+            }
+        ],
+        "http://example.com/myproperty": [
+            {
+                "@id": "http://example.org/id2"
+            }
+        ],
+        "http://example.com/myset1": [
+
+        ],
+        "http://example.com/myset2": [
+
+        ]
+    },
+    {
+        "@id": "_:t0"
+    },
+    {
+        "@id": "http://example.org/id2",
+        "http://example.org/myproperty2": [
+            {
+                "@value": "ok"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0017-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,45 @@
+{
+  "@context": {
+    "authored": {
+      "@id": "http://example.org/vocab#authored",
+      "@type": "@id"
+    },
+    "contains": {
+      "@id": "http://example.org/vocab#contains",
+      "@type": "@id"
+    },
+    "contributor": "http://purl.org/dc/elements/1.1/contributor",
+    "description": "http://purl.org/dc/elements/1.1/description",
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "title": {
+      "@id": "http://purl.org/dc/elements/1.1/title"
+    },
+    "id": "@id",
+    "data": "@graph"
+  },
+  "data": [
+    {
+      "id": "http://example.org/test#chapter",
+      "description": "Fun",
+      "title": "Chapter One"
+    },
+    {
+      "@id": "http://example.org/test#jane",
+      "authored": "http://example.org/test#chapter",
+      "name": "Jane"
+    },
+    {
+      "id": "http://example.org/test#john",
+      "name": "John"
+    },
+    {
+      "id": "http://example.org/test#library",
+      "contains": {
+        "@id": "http://example.org/test#book",
+        "contains": "http://example.org/test#chapter",
+        "contributor": "Writer",
+        "title": "My Book"
+      }
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0017-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,62 @@
+[
+    {
+        "@id": "http://example.org/test#chapter",
+        "http://purl.org/dc/elements/1.1/description": [
+            {
+                "@value": "Fun"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "Chapter One"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#jane",
+        "http://example.org/vocab#authored": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Jane"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#john",
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "John"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#library",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#book"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#book",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/contributor": [
+            {
+                "@value": "Writer"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "My Book"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0018-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,24 @@
+{
+  "@context": {
+    "ex": "http://example.org/vocab#",
+    "@language": "en",
+    "de": { "@id": "ex:german", "@language": "de" },
+    "nolang": { "@id": "ex:nolang", "@language": null }
+  },
+  "@id": "http://example.org/test",
+  "ex:test-default": [
+    "hello",
+    1,
+    true
+  ],
+  "de": [
+    "hallo",
+    2,
+    true
+  ],
+  "nolang": [
+    "no language",
+    3,
+    false
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0018-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,34 @@
+[
+    {
+        "@id": "http://example.org/test",
+        "http://example.org/vocab#german": [
+            {
+                "@value": "hallo",
+                "@language": "de"
+            },
+            {
+                "@value": 2
+            }
+        ],
+        "http://example.org/vocab#nolang": [
+            {
+                "@value": "no language"
+            },
+            {
+                "@value": 3
+            },
+            {
+                "@value": false
+            }
+        ],
+        "http://example.org/vocab#test-default": [
+            {
+                "@value": "hello",
+                "@language": "en"
+            },
+            {
+                "@value": 1
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0019-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,6 @@
+{
+  "@context": {
+    "myproperty": "http://example.com/myproperty"
+  },
+  "myproperty": { "@value" : null }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0019-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,5 @@
+[
+    {
+        "@id": "_:t0"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0020-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,51 @@
+{
+  "@context": {
+    "authored": {
+      "@id": "http://example.org/vocab#authored",
+      "@type": "@id"
+    },
+    "contains": {
+      "@id": "http://example.org/vocab#contains",
+      "@type": "@id"
+    },
+    "contributor": "http://purl.org/dc/elements/1.1/contributor",
+    "description": "http://purl.org/dc/elements/1.1/description",
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "title": {
+      "@id": "http://purl.org/dc/elements/1.1/title"
+    }
+  },
+  "@graph": [
+    {
+      "@id": "http://example.org/test#jane",
+      "name": "Jane",
+      "authored": {
+        "@graph": [
+          {
+            "@id": "http://example.org/test#chapter1",
+            "description": "Fun",
+            "title": "Chapter One"
+          },
+          {
+            "@id": "http://example.org/test#chapter2",
+            "description": "More fun",
+            "title": "Chapter Two"
+          }
+        ]
+      }
+    },
+    {
+      "@id": "http://example.org/test#john",
+      "name": "John"
+    },
+    {
+      "@id": "http://example.org/test#library",
+      "contains": {
+        "@id": "http://example.org/test#book",
+        "contains": "http://example.org/test#chapter",
+        "contributor": "Writer",
+        "title": "My Book"
+      }
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0020-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,83 @@
+[
+    {
+        "@id": "http://example.org/test#jane",
+        "http://example.org/vocab#authored": [
+            {
+                "@id": "_:t0"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Jane"
+            }
+        ]
+    },
+    {
+        "@id": "_:t0",
+        "@graph": [
+            {
+                "@id": "http://example.org/test#chapter1",
+                "http://purl.org/dc/elements/1.1/description": [
+                    {
+                        "@value": "Fun"
+                    }
+                ],
+                "http://purl.org/dc/elements/1.1/title": [
+                    {
+                        "@value": "Chapter One"
+                    }
+                ]
+            },
+            {
+                "@id": "http://example.org/test#chapter2",
+                "http://purl.org/dc/elements/1.1/description": [
+                    {
+                        "@value": "More fun"
+                    }
+                ],
+                "http://purl.org/dc/elements/1.1/title": [
+                    {
+                        "@value": "Chapter Two"
+                    }
+                ]
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#john",
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "John"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#library",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#book"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#book",
+        "http://example.org/vocab#contains": [
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/contributor": [
+            {
+                "@value": "Writer"
+            }
+        ],
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "My Book"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/test#chapter"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0021-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,53 @@
+{
+  "@context": {
+    "authored": {
+      "@id": "http://example.org/vocab#authored",
+      "@type": "@id"
+    },
+    "contains": {
+      "@id": "http://example.org/vocab#contains",
+      "@type": "@id"
+    },
+    "contributor": "http://purl.org/dc/elements/1.1/contributor",
+    "description": "http://purl.org/dc/elements/1.1/description",
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "title": {
+      "@id": "http://purl.org/dc/elements/1.1/title"
+    }
+  },
+  "title": "My first graph",
+  "@graph": [
+    {
+      "@id": "http://example.org/test#jane",
+      "name": "Jane",
+      "authored": {
+        "@graph": [
+          {
+            "@id": "http://example.org/test#chapter1",
+            "description": "Fun",
+            "title": "Chapter One"
+          },
+          {
+            "@id": "http://example.org/test#chapter2",
+            "description": "More fun",
+            "title": "Chapter Two"
+          },
+          "http://example.org/test#chapter3"
+        ]
+      }
+    },
+    {
+      "@id": "http://example.org/test#john",
+      "name": "John"
+    },
+    {
+      "@id": "http://example.org/test#library",
+      "contains": {
+        "@id": "http://example.org/test#book",
+        "contains": "http://example.org/test#chapter",
+        "contributor": "Writer",
+        "title": "My Book"
+      }
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0021-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,99 @@
+[
+    {
+        "@id": "_:t0",
+        "http://purl.org/dc/elements/1.1/title": [
+            {
+                "@value": "My first graph"
+            }
+        ],
+        "@graph": [
+            {
+                "@id": "http://example.org/test#jane",
+                "http://example.org/vocab#authored": [
+                    {
+                        "@id": "_:t1"
+                    }
+                ],
+                "http://xmlns.com/foaf/0.1/name": [
+                    {
+                        "@value": "Jane"
+                    }
+                ]
+            },
+            {
+                "@id": "_:t1"
+            },
+            {
+                "@id": "http://example.org/test#john",
+                "http://xmlns.com/foaf/0.1/name": [
+                    {
+                        "@value": "John"
+                    }
+                ]
+            },
+            {
+                "@id": "http://example.org/test#library",
+                "http://example.org/vocab#contains": [
+                    {
+                        "@id": "http://example.org/test#book"
+                    }
+                ]
+            },
+            {
+                "@id": "http://example.org/test#book",
+                "http://example.org/vocab#contains": [
+                    {
+                        "@id": "http://example.org/test#chapter"
+                    }
+                ],
+                "http://purl.org/dc/elements/1.1/contributor": [
+                    {
+                        "@value": "Writer"
+                    }
+                ],
+                "http://purl.org/dc/elements/1.1/title": [
+                    {
+                        "@value": "My Book"
+                    }
+                ]
+            },
+            {
+                "@id": "http://example.org/test#chapter"
+            }
+        ]
+    },
+    {
+        "@id": "_:t1",
+        "@graph": [
+            {
+                "@id": "http://example.org/test#chapter1",
+                "http://purl.org/dc/elements/1.1/description": [
+                    {
+                        "@value": "Fun"
+                    }
+                ],
+                "http://purl.org/dc/elements/1.1/title": [
+                    {
+                        "@value": "Chapter One"
+                    }
+                ]
+            },
+            {
+                "@id": "http://example.org/test#chapter2",
+                "http://purl.org/dc/elements/1.1/description": [
+                    {
+                        "@value": "More fun"
+                    }
+                ],
+                "http://purl.org/dc/elements/1.1/title": [
+                    {
+                        "@value": "Chapter Two"
+                    }
+                ]
+            },
+            {
+                "@id": "http://example.org/test#chapter3"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0022-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "term": "http://example.com/term",
+    "@language": "en"
+  },
+  "term": "v"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0022-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,11 @@
+[
+    {
+        "@id": "_:t0",
+        "http://example.com/term": [
+            {
+                "@value": "v",
+                "@language": "en"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0023-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,21 @@
+{
+  "@context": {
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "idlist": {"@id": "http://example.com/idlist", "@container": "@list", "@type": "@id"},
+    "datelist": {"@id": "http://example.com/datelist", "@container": "@list", "@type": "xsd:date"},
+    "idset": {"@id": "http://example.com/idset", "@container": "@set", "@type": "@id"},
+    "dateset": {"@id": "http://example.com/dateset", "@container": "@set", "@type": "xsd:date"},
+    "idprop": {"@id": "http://example.com/idprop", "@type": "@id" },
+    "dateprop": {"@id": "http://example.com/dateprop", "@type": "xsd:date" },
+    "idprop2": {"@id": "http://example.com/idprop2", "@type": "@id" },
+    "dateprop2": {"@id": "http://example.com/dateprop2", "@type": "xsd:date" }
+  },
+  "idlist": ["http://example.org/id"],
+  "datelist": ["2012-04-12"],
+  "idprop": {"@list": ["http://example.org/id"]},
+  "dateprop": {"@list": ["2012-04-12"]},
+  "idset": ["http://example.org/id"],
+  "dateset": ["2012-04-12"],
+  "idprop2": {"@set": ["http://example.org/id"]},
+  "dateprop2": {"@set": ["2012-04-12"]}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0023-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,68 @@
+[
+    {
+        "@id": "_:t0",
+        "http://example.com/datelist": [
+            {
+                "@list": [
+                    {
+                        "@value": "2012-04-12",
+                        "@type": "http://www.w3.org/2001/XMLSchema#date"
+                    }
+                ]
+            }
+        ],
+        "http://example.com/dateprop": [
+            {
+                "@list": [
+                    {
+                        "@value": "2012-04-12",
+                        "@type": "http://www.w3.org/2001/XMLSchema#date"
+                    }
+                ]
+            }
+        ],
+        "http://example.com/dateprop2": [
+            {
+                "@value": "2012-04-12",
+                "@type": "http://www.w3.org/2001/XMLSchema#date"
+            }
+        ],
+        "http://example.com/dateset": [
+            {
+                "@value": "2012-04-12",
+                "@type": "http://www.w3.org/2001/XMLSchema#date"
+            }
+        ],
+        "http://example.com/idlist": [
+            {
+                "@list": [
+                    {
+                        "@id": "http://example.org/id"
+                    }
+                ]
+            }
+        ],
+        "http://example.com/idprop": [
+            {
+                "@list": [
+                    {
+                        "@id": "http://example.org/id"
+                    }
+                ]
+            }
+        ],
+        "http://example.com/idprop2": [
+            {
+                "@id": "http://example.org/id"
+            }
+        ],
+        "http://example.com/idset": [
+            {
+                "@id": "http://example.org/id"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/id"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0024-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,14 @@
+{
+  "@context": [
+    {
+      "name": "http://xmlns.com/foaf/0.1/name",
+      "homepage": {"@id": "http://xmlns.com/foaf/0.1/homepage","@type": "@id"}
+    },
+    {"ical": "http://www.w3.org/2002/12/cal/ical#"}
+  ],
+  "@id": "http://example.com/speakers#Alice",
+  "name": "Alice",
+  "homepage": "http://xkcd.com/177/",
+  "ical:summary": "Alice Talk",
+  "ical:location": "Lyon Convention Centre, Lyon, France"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0024-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,28 @@
+[
+    {
+        "@id": "http://example.com/speakers#Alice",
+        "http://www.w3.org/2002/12/cal/ical#location": [
+            {
+                "@value": "Lyon Convention Centre, Lyon, France"
+            }
+        ],
+        "http://www.w3.org/2002/12/cal/ical#summary": [
+            {
+                "@value": "Alice Talk"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/homepage": [
+            {
+                "@id": "http://xkcd.com/177/"
+            }
+        ],
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Alice"
+            }
+        ]
+    },
+    {
+        "@id": "http://xkcd.com/177/"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0025-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,10 @@
+{
+  "@context": {
+    "foo": "http://example.com/foo/",
+    "foo:bar": "http://example.com/bar",
+    "bar": {"@id": "foo:bar", "@type": "@id"},
+    "_": "http://example.com/underscore/"
+  },
+  "@id": "_",
+  "bar": ["foo", "foo:bar"]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0025-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,19 @@
+[
+    {
+        "@id": "http://example.com/underscore/",
+        "http://example.com/bar": [
+            {
+                "@id": "http://example.com/foo/"
+            },
+            {
+                "@id": "http://example.com/bar"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.com/foo/"
+    },
+    {
+        "@id": "http://example.com/bar"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0026-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,20 @@
+{
+  "@context": {
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {"@id": "@type", "@type": "@id"}
+  },
+  "@graph": [
+    {
+      "@id": "http://example.com/a",
+      "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://example.com/b"
+    }, {
+      "@id": "http://example.com/c",
+      "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
+        "http://example.com/d",
+        "http://example.com/e"
+      ]
+    }, {
+      "@id": "http://example.com/f",
+      "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://example.com/g"
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0026-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,21 @@
+[
+    {
+        "@id": "http://example.com/a",
+        "@type": [
+            "http://example.com/b"
+        ]
+    },
+    {
+        "@id": "http://example.com/c",
+        "@type": [
+            "http://example.com/d",
+            "http://example.com/e"
+        ]
+    },
+    {
+        "@id": "http://example.com/f",
+        "@type": [
+            "http://example.com/g"
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0027-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,9 @@
+{
+  "@context": {
+    "mylist": {"@id": "http://example.com/mylist", "@container": "@list"},
+    "myset": {"@id": "http://example.com/myset", "@container": "@set"}
+  },
+  "@id": "http://example.org/id",
+  "mylist": [1, 2, 2, 3],
+  "myset": [1, 2, 2, 3]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0027-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,34 @@
+[
+    {
+        "@id": "http://example.org/id",
+        "http://example.com/mylist": [
+            {
+                "@list": [
+                    {
+                        "@value": 1
+                    },
+                    {
+                        "@value": 2
+                    },
+                    {
+                        "@value": 2
+                    },
+                    {
+                        "@value": 3
+                    }
+                ]
+            }
+        ],
+        "http://example.com/myset": [
+            {
+                "@value": 1
+            },
+            {
+                "@value": 2
+            },
+            {
+                "@value": 3
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0028-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,13 @@
+{
+  "@context": {
+    "@vocab": "http://example.org/vocab#",
+    "date": { "@type": "dateTime" }
+  },
+  "@id": "example1",
+  "@type": "test",
+  "date": "2011-01-25T00:00:00Z",
+  "embed": {
+    "@id": "example2",
+    "expandedDate": { "@value": "2012-08-01T00:00:00Z", "@type": "dateTime" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0028-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,28 @@
+[
+    {
+        "@id": "http://json-ld.org/test-suite/tests/example1",
+        "@type": [
+            "http://example.org/vocab#test"
+        ],
+        "http://example.org/vocab#date": [
+            {
+                "@value": "2011-01-25T00:00:00Z",
+                "@type": "http://example.org/vocab#dateTime"
+            }
+        ],
+        "http://example.org/vocab#embed": [
+            {
+                "@id": "http://json-ld.org/test-suite/tests/example2"
+            }
+        ]
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/tests/example2",
+        "http://example.org/vocab#expandedDate": [
+            {
+                "@type": "http://example.org/vocab#dateTime",
+                "@value": "2012-08-01T00:00:00Z"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0029-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,32 @@
+{
+  "@context": {
+    "links": { "@id": "http://www.example.com/link", "@type": "@id", "@container": "@list" }
+  },
+  "@id": "relativeIris",
+  "@type": [
+    "link",
+    "#fragment-works",
+    "?query=works",
+    "./",
+    "../",
+    "../parent",
+    "../../parent-parent-eq-root",
+    "../../../../../still-root",
+    "../.././.././../../too-many-dots",
+    "/absolute",
+    "//example.org/scheme-relative"
+  ],
+  "links": [
+    "link",
+    "#fragment-works",
+    "?query=works",
+    "./",
+    "../",
+    "../parent",
+    "../../parent-parent-eq-root",
+    "./../../../useless/../../../still-root",
+    "../.././.././../../too-many-dots",
+    "/absolute",
+    "//example.org/scheme-relative"
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0029-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,90 @@
+[
+    {
+        "@id": "http://json-ld.org/test-suite/tests/relativeIris",
+        "@type": [
+            "http://json-ld.org/test-suite/tests/link",
+            "http://json-ld.org/test-suite/tests/flatten-0029-in.jsonld#fragment-works",
+            "http://json-ld.org/test-suite/tests/flatten-0029-in.jsonld?query=works",
+            "http://json-ld.org/test-suite/tests/",
+            "http://json-ld.org/test-suite/",
+            "http://json-ld.org/test-suite/parent",
+            "http://json-ld.org/parent-parent-eq-root",
+            "http://json-ld.org/still-root",
+            "http://json-ld.org/too-many-dots",
+            "http://json-ld.org/absolute",
+            "http://example.org/scheme-relative"
+        ],
+        "http://www.example.com/link": [
+            {
+                "@list": [
+                    {
+                        "@id": "http://json-ld.org/test-suite/tests/link"
+                    },
+                    {
+                        "@id": "http://json-ld.org/test-suite/tests/flatten-0029-in.jsonld#fragment-works"
+                    },
+                    {
+                        "@id": "http://json-ld.org/test-suite/tests/flatten-0029-in.jsonld?query=works"
+                    },
+                    {
+                        "@id": "http://json-ld.org/test-suite/tests/"
+                    },
+                    {
+                        "@id": "http://json-ld.org/test-suite/"
+                    },
+                    {
+                        "@id": "http://json-ld.org/test-suite/parent"
+                    },
+                    {
+                        "@id": "http://json-ld.org/parent-parent-eq-root"
+                    },
+                    {
+                        "@id": "http://json-ld.org/still-root"
+                    },
+                    {
+                        "@id": "http://json-ld.org/too-many-dots"
+                    },
+                    {
+                        "@id": "http://json-ld.org/absolute"
+                    },
+                    {
+                        "@id": "http://example.org/scheme-relative"
+                    }
+                ]
+            }
+        ]
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/tests/link"
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/tests/flatten-0029-in.jsonld#fragment-works"
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/tests/flatten-0029-in.jsonld?query=works"
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/tests/"
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/"
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/parent"
+    },
+    {
+        "@id": "http://json-ld.org/parent-parent-eq-root"
+    },
+    {
+        "@id": "http://json-ld.org/still-root"
+    },
+    {
+        "@id": "http://json-ld.org/too-many-dots"
+    },
+    {
+        "@id": "http://json-ld.org/absolute"
+    },
+    {
+        "@id": "http://example.org/scheme-relative"
+    }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0030-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "vocab": "http://example.com/vocab/",
+    "label": {
+      "@id": "vocab:label",
+      "@container": "@language"
+    }
+  },
+  "@id": "http://example.com/queen",
+  "label": {
+    "en": "The Queen",
+    "de": [ "Die Königin", "Ihre Majestät" ]
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0030-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,19 @@
+[
+    {
+        "@id": "http://example.com/queen",
+        "http://example.com/vocab/label": [
+            {
+                "@value": "Die Königin",
+                "@language": "de"
+            },
+            {
+                "@value": "Ihre Majestät",
+                "@language": "de"
+            },
+            {
+                "@value": "The Queen",
+                "@language": "en"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0031-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,13 @@
+{
+  "@context": {
+    "ex": "http://example.org/vocab#",
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "ex:integer": { "@type": "xsd:integer" },
+    "ex:double": { "@type": "xsd:double" },
+    "ex:boolean": { "@type": "xsd:boolean" }
+  },
+  "@id": "http://example.org/test#example1",
+  "ex:integer": 1,
+  "ex:double": 123.45,
+  "ex:boolean": true
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0031-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,23 @@
+[
+    {
+        "@id": "http://example.org/test#example1",
+        "http://example.org/vocab#boolean": [
+            {
+                "@value": true,
+                "@type": "http://www.w3.org/2001/XMLSchema#boolean"
+            }
+        ],
+        "http://example.org/vocab#double": [
+            {
+                "@value": 123.45,
+                "@type": "http://www.w3.org/2001/XMLSchema#double"
+            }
+        ],
+        "http://example.org/vocab#integer": [
+            {
+                "@value": 1,
+                "@type": "http://www.w3.org/2001/XMLSchema#integer"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0032-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,11 @@
+{
+  "@context": {
+    "@vocab": "http://xmlns.com/foaf/0.1/",
+    "from": null,
+    "university": { "@id": null }
+  },
+  "@id": "http://me.markus-lanthaler.com/",
+  "name": "Markus Lanthaler",
+  "from": "Italy",
+  "university": "TU Graz"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0032-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,10 @@
+[
+    {
+        "@id": "http://me.markus-lanthaler.com/",
+        "http://xmlns.com/foaf/0.1/name": [
+            {
+                "@value": "Markus Lanthaler"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0033-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/vocab#",
+    "homepage": {
+      "@type": "@id"
+    },
+    "created_at": {
+      "@type": "http://www.w3.org/2001/XMLSchema#date"
+    }
+  },
+  "name": "Markus Lanthaler",
+  "homepage": "http://www.markus-lanthaler.com/",
+  "created_at": "2012-10-28"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0033-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,24 @@
+[
+    {
+        "@id": "_:t0",
+        "http://example.com/vocab#created_at": [
+            {
+                "@value": "2012-10-28",
+                "@type": "http://www.w3.org/2001/XMLSchema#date"
+            }
+        ],
+        "http://example.com/vocab#homepage": [
+            {
+                "@id": "http://www.markus-lanthaler.com/"
+            }
+        ],
+        "http://example.com/vocab#name": [
+            {
+                "@value": "Markus Lanthaler"
+            }
+        ]
+    },
+    {
+        "@id": "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/flatten-0034-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,16 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/vocab/",
+    "colliding": "http://example.com/vocab/collidingTerm"
+  },
+  "@id": "http://example.com/IriCollissions",
+  "colliding": [
+    "value 1",
+    2
+  ],
+  "collidingTerm": [
+    3,
+    "four"
+  ],
+  "http://example.com/vocab/collidingTerm": 5
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0034-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,22 @@
+[
+    {
+        "@id": "http://example.com/IriCollissions",
+        "http://example.com/vocab/collidingTerm": [
+            {
+                "@value": "value 1"
+            },
+            {
+                "@value": 2
+            },
+            {
+                "@value": 3
+            },
+            {
+                "@value": "four"
+            },
+            {
+                "@value": 5
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0035-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,18 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/vocab/",
+    "@language": "it",
+    "label": {
+      "@container": "@language"
+    }
+  },
+  "@id": "http://example.com/queen",
+  "label": {
+    "en": "The Queen",
+    "de": [ "Die Königin", "Ihre Majestät" ]
+  },
+  "http://example.com/vocab/label": [
+    "Il re",
+    { "@value": "The king", "@language": "en" }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0035-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,27 @@
+[
+    {
+        "@id": "http://example.com/queen",
+        "http://example.com/vocab/label": [
+            {
+                "@value": "Il re",
+                "@language": "it"
+            },
+            {
+                "@language": "en",
+                "@value": "The king"
+            },
+            {
+                "@value": "Die Königin",
+                "@language": "de"
+            },
+            {
+                "@value": "Ihre Majestät",
+                "@language": "de"
+            },
+            {
+                "@value": "The Queen",
+                "@language": "en"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0036-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,94 @@
+{
+  "@context": {
+    "property": "http://example.com/property",
+    "annotContainer": { "@id": "http://example.com/container", "@container": "@annotation" }
+  },
+  "@id": "http://example.org/annotationsTest",
+  "annotContainer": {
+    "A": [
+      {
+        "@id": "http://example.org/nodeWithoutAnnotationA"
+      },
+      {
+        "@id": "http://example.org/nodeWithAnnotationA",
+        "@annotation": "this overrides the 'A' annotation from the container"
+      },
+      1,
+      true,
+      false,
+      null,
+      "simple string A",
+      {
+        "@value": "typed literal A",
+        "@type": "http://example.org/type"
+      },
+      {
+        "@value": "language-tagged string A",
+        "@language": "en"
+      }
+    ],
+    "B": "simple string B",
+    "C": [
+      {
+        "@id": "http://example.org/nodeWithoutAnnotationC"
+      },
+      {
+        "@id": "http://example.org/nodeWithAnnotationC",
+        "@annotation": "this overrides the 'C' annotation from the container"
+      },
+      3,
+      true,
+      false,
+      null,
+      "simple string C",
+      {
+        "@value": "typed literal C",
+        "@type": "http://example.org/type"
+      },
+      {
+        "@value": "language-tagged string C",
+        "@language": "en"
+      }
+    ]
+  },
+  "property": [
+    {
+      "@id": "http://example.org/nodeWithoutAnnotationProp"
+    },
+    {
+      "@id": "http://example.org/nodeWithAnnotationProp",
+      "@annotation": "prop"
+    },
+    {
+      "@value": 3,
+      "@annotation": "prop"
+    },
+    {
+      "@value": true,
+      "@annotation": "prop"
+    },
+    {
+      "@value": false,
+      "@annotation": "prop"
+    },
+    {
+      "@value": null,
+      "@annotation": "prop"
+    },
+    "simple string no annotation",
+    {
+      "@value": "typed literal Prop",
+      "@type": "http://example.org/type",
+      "@annotation": "prop"
+    },
+    {
+      "@value": "language-tagged string Prop",
+      "@language": "en",
+      "@annotation": "prop"
+    },
+    {
+      "@value": "annotation using an array with just one element (automatic recovery)",
+      "@annotation": [ "prop" ]
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0036-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,133 @@
+[
+    {
+        "@id": "http://example.org/annotationsTest",
+        "http://example.com/container": [
+            {
+                "@id": "http://example.org/nodeWithoutAnnotationA"
+            },
+            {
+                "@id": "http://example.org/nodeWithAnnotationA"
+            },
+            {
+                "@value": 1,
+                "@annotation": "A"
+            },
+            {
+                "@value": false,
+                "@annotation": "A"
+            },
+            {
+                "@value": "simple string A",
+                "@annotation": "A"
+            },
+            {
+                "@type": "http://example.org/type",
+                "@value": "typed literal A",
+                "@annotation": "A"
+            },
+            {
+                "@language": "en",
+                "@value": "language-tagged string A",
+                "@annotation": "A"
+            },
+            {
+                "@value": "simple string B",
+                "@annotation": "B"
+            },
+            {
+                "@id": "http://example.org/nodeWithoutAnnotationC"
+            },
+            {
+                "@id": "http://example.org/nodeWithAnnotationC"
+            },
+            {
+                "@value": 3,
+                "@annotation": "C"
+            },
+            {
+                "@value": false,
+                "@annotation": "C"
+            },
+            {
+                "@value": "simple string C",
+                "@annotation": "C"
+            },
+            {
+                "@type": "http://example.org/type",
+                "@value": "typed literal C",
+                "@annotation": "C"
+            },
+            {
+                "@language": "en",
+                "@value": "language-tagged string C",
+                "@annotation": "C"
+            }
+        ],
+        "http://example.com/property": [
+            {
+                "@id": "http://example.org/nodeWithoutAnnotationProp"
+            },
+            {
+                "@id": "http://example.org/nodeWithAnnotationProp"
+            },
+            {
+                "@annotation": "prop",
+                "@value": 3
+            },
+            {
+                "@annotation": "prop",
+                "@value": false
+            },
+            {
+                "@value": "simple string no annotation"
+            },
+            {
+                "@annotation": "prop",
+                "@type": "http://example.org/type",
+                "@value": "typed literal Prop"
+            },
+            {
+                "@annotation": "prop",
+                "@language": "en",
+                "@value": "language-tagged string Prop"
+            },
+            {
+                "@annotation": "prop",
+                "@value": "annotation using an array with just one element (automatic recovery)"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.org/nodeWithoutAnnotationA",
+        "@annotation": [
+            "A"
+        ]
+    },
+    {
+        "@id": "http://example.org/nodeWithAnnotationA",
+        "@annotation": [
+            "this overrides the 'A' annotation from the container"
+        ]
+    },
+    {
+        "@id": "http://example.org/nodeWithoutAnnotationC",
+        "@annotation": [
+            "C"
+        ]
+    },
+    {
+        "@id": "http://example.org/nodeWithAnnotationC",
+        "@annotation": [
+            "this overrides the 'C' annotation from the container"
+        ]
+    },
+    {
+        "@id": "http://example.org/nodeWithoutAnnotationProp"
+    },
+    {
+        "@id": "http://example.org/nodeWithAnnotationProp",
+        "@annotation": [
+            "prop"
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0037-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,18 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ]
+    },
+    "field_related": {
+      "@id": [ "site:vocab/field_related", "http://schema.org/about" ]
+    }
+  },
+  "@id": "site:node/1",
+  "field_tags": [
+    { "@id": "site:term/this-is-a-tag" }
+  ],
+  "field_related": [
+    { "@id": "site:node/this-is-related-news" }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0037-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,29 @@
+[
+    {
+        "@id": "http://example.com/node/1",
+        "http://example.com/vocab/field_related": [
+            {
+                "@id": "http://example.com/node/this-is-related-news"
+            }
+        ],
+        "http://example.com/vocab/field_tags": [
+            {
+                "@id": "http://example.com/term/this-is-a-tag"
+            }
+        ],
+        "http://schema.org/about": [
+            {
+                "@id": "http://example.com/node/this-is-related-news"
+            },
+            {
+                "@id": "http://example.com/term/this-is-a-tag"
+            }
+        ]
+    },
+    {
+        "@id": "http://example.com/node/this-is-related-news"
+    },
+    {
+        "@id": "http://example.com/term/this-is-a-tag"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0038-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,59 @@
+{
+  "@context": {
+    "term": "_:term",
+    "termId": { "@id": "term", "@type": "@id" },
+    "termTyped": { "@id": "term", "@type": "_:term" }
+  },
+  "@id": "term",
+  "@type": "_:term",
+  "term": [
+    {
+      "@id": "term",
+      "@type": "term",
+      "termTyped": "typed value term"
+    },
+    {
+      "@id": "_:Bx",
+      "term": "term"
+    },
+    "plain value",
+    {
+      "@id": "_:term"
+    },
+    {
+      "@value": "term: typed value with type set to bnode",
+      "@type": "_:term"
+    },
+    {
+      "@value": "term: typed value with type set to term",
+      "@type": "term"
+    }
+  ],
+  "termId": [
+    {
+      "@id": "term",
+      "@type": "term",
+      "termTyped": "typed value termId"
+    },
+    {
+      "@id": "_:Cx",
+      "term": "termId"
+    },
+    "term:AppendedToBlankNode",
+    "relativeIri",
+    {
+      "@id": "_:term"
+    },
+    {
+      "@value": "termId: typed value with type set to bnode",
+      "@type": "_:term"
+    },
+    {
+      "@value": "ternId: typed value with type set to term",
+      "@type": "term"
+    }
+  ],
+  "termTyped": [
+    "termTyped: value"
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0038-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,78 @@
+[
+    {
+        "@id": "_:t0",
+        "@type": [
+            "_:t0"
+        ],
+        "_:t0": [
+            {
+                "@id": "_:t0"
+            },
+            {
+                "@value": "typed value term",
+                "@type": "_:t0"
+            },
+            {
+                "@id": "_:t1"
+            },
+            {
+                "@value": "plain value"
+            },
+            {
+                "@type": "_:t0",
+                "@value": "term: typed value with type set to bnode"
+            },
+            {
+                "@type": "_:t0",
+                "@value": "term: typed value with type set to term"
+            },
+            {
+                "@value": "typed value termId",
+                "@type": "_:t0"
+            },
+            {
+                "@id": "_:t2"
+            },
+            {
+                "@id": "_:t3"
+            },
+            {
+                "@id": "http://json-ld.org/test-suite/tests/relativeIri"
+            },
+            {
+                "@type": "_:t0",
+                "@value": "termId: typed value with type set to bnode"
+            },
+            {
+                "@type": "_:t0",
+                "@value": "ternId: typed value with type set to term"
+            },
+            {
+                "@value": "termTyped: value",
+                "@type": "_:t0"
+            }
+        ]
+    },
+    {
+        "@id": "_:t1",
+        "_:t0": [
+            {
+                "@value": "term"
+            }
+        ]
+    },
+    {
+        "@id": "_:t2",
+        "_:t0": [
+            {
+                "@value": "termId"
+            }
+        ]
+    },
+    {
+        "@id": "_:t3"
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/tests/relativeIri"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0039-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,161 @@
+{
+  "@context": {
+    "vocab": "http://example.com/vocab/",
+    "sharedTerm": "http://www.example.org/shared/term",
+    "@language": "de",
+    "propGenA": {
+      "@id": [ "vocab:propGenA", "sharedTerm" ]
+    },
+    "propGenB": {
+      "@id": [ "sharedTerm", "vocab:propGenB", "http://example.com/somethingElse" ],
+      "@type": "http://datatype.example.org/type",
+      "@container": "@list"
+    },
+    "propGenC": {
+      "@id": [ "sharedTerm", "vocab:propGenB", "http://example.com/somethingElse" ],
+      "@language": "en"
+    }
+  },
+  "@id": "http://ex.com/root",
+  "propGenA": [
+    {
+      "@id": "http://ex.com/propA.1"
+    },
+    {
+      "vocab:term": "http://ex.com/propA.2"
+    },
+    "propA.3",
+    {
+      "@id": "http://ex.com/propA.4"
+    },
+    {
+      "vocab:term": "http://ex.com/propA.5",
+      "vocab:nested": [
+        {
+          "vocab:term": "http://ex.com/propA.5.1",
+          "vocab:nested": [
+            10510,
+            "propA.5.1.1",
+            {
+              "@id": "http://ex.com/propA.5.1.2"
+            },
+            {
+              "vocab:term": "http://ex.com/propA.5.1.3"
+            }
+          ]
+        },
+        {
+          "@id": "http://ex.com/propA.5.2",
+          "vocab:nested": [
+            "propA.5.2.1",
+            {
+              "vocab:term": "http://ex.com/propA.5.2.2"
+            },
+            {
+              "@id": "http://ex.com/propA.5.2.3"
+            },
+            10524
+          ]
+        }
+      ]
+    },
+    10600,
+    {
+      "vocab:term": "collission"
+    }
+  ],
+  "propGenB": [
+    20000,
+    "propB.1",
+    {
+      "vocab:term": "collission"
+    },
+    {
+      "@id": "http://ex.com/propB.2",
+      "vocab:nested": [
+        {
+          "vocab:term": "http://ex.com/propB.2.1",
+          "vocab:nested": [
+            20110,
+            "propB.2.1.1",
+            {
+              "@id": "http://ex.com/propB.2.1.2"
+            },
+            {
+              "vocab:term": "http://ex.com/propB.2.1.3"
+            }
+          ]
+        },
+        {
+          "@id": "http://ex.com/propB.2.2",
+          "vocab:nested": [
+            "propB.2.2.1",
+            {
+              "vocab:term": "http://ex.com/propB.2.2.2"
+            },
+            {
+              "@id": "http://ex.com/propB.2.2.3"
+            },
+            20224
+          ]
+        }
+      ]
+    },
+    {
+      "vocab:term": "http://ex.com/propB.3"
+    }
+  ],
+  "propGenC": [
+    {
+      "vocab:term": "collission"
+    },
+    "propC.2",
+    30300,
+    {
+      "@id": "http://ex.com/propC.4"
+    },
+    {
+      "vocab:term": "http://ex.com/propC.5",
+      "vocab:nested": [
+        {
+          "vocab:term": "http://ex.com/propC.5.1",
+          "vocab:nested": [
+            10510,
+            "propC.5.1.1",
+            {
+              "@id": "http://ex.com/propC.5.1.2"
+            },
+            {
+              "vocab:term": "http://ex.com/propC.5.1.3"
+            }
+          ]
+        },
+        {
+          "@id": "http://ex.com/propC.5.2",
+          "vocab:nested": [
+            "propC.5.2.1",
+            {
+              "vocab:term": "http://ex.com/propC.5.2.2"
+            },
+            {
+              "@id": "http://ex.com/propC.5.2.3"
+            },
+            10524
+          ]
+        }
+      ]
+    }
+  ],
+  "http://example.com/vocab/propGenA": [
+    "propGenA.coll.1",
+    {
+      "vocab:term": "collission"
+    }
+  ],
+  "http://example.com/vocab/propGenB": [
+    "propGenB.coll.1",
+    {
+      "vocab:term": "collission"
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0039-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,497 @@
+[
+    {
+        "@id": "http://ex.com/root",
+        "http://example.com/somethingElse": [
+            {
+                "@list": [
+                    {
+                        "@value": 20000,
+                        "@type": "http://datatype.example.org/type"
+                    },
+                    {
+                        "@value": "propB.1",
+                        "@type": "http://datatype.example.org/type"
+                    },
+                    {
+                        "@id": "_:t0"
+                    },
+                    {
+                        "@id": "http://ex.com/propB.2"
+                    },
+                    {
+                        "@id": "_:t4"
+                    }
+                ]
+            },
+            {
+                "@id": "_:t5"
+            },
+            {
+                "@value": "propC.2",
+                "@language": "en"
+            },
+            {
+                "@value": 30300
+            },
+            {
+                "@id": "http://ex.com/propC.4"
+            },
+            {
+                "@id": "_:t6"
+            }
+        ],
+        "http://example.com/vocab/propGenA": [
+            {
+                "@value": "propGenA.coll.1",
+                "@language": "de"
+            },
+            {
+                "@id": "_:t10"
+            },
+            {
+                "@id": "http://ex.com/propA.1"
+            },
+            {
+                "@id": "_:t11"
+            },
+            {
+                "@value": "propA.3",
+                "@language": "de"
+            },
+            {
+                "@id": "http://ex.com/propA.4"
+            },
+            {
+                "@id": "_:t12"
+            },
+            {
+                "@value": 10600
+            },
+            {
+                "@id": "_:t16"
+            }
+        ],
+        "http://example.com/vocab/propGenB": [
+            {
+                "@value": "propGenB.coll.1",
+                "@language": "de"
+            },
+            {
+                "@id": "_:t17"
+            },
+            {
+                "@list": [
+                    {
+                        "@value": 20000,
+                        "@type": "http://datatype.example.org/type"
+                    },
+                    {
+                        "@value": "propB.1",
+                        "@type": "http://datatype.example.org/type"
+                    },
+                    {
+                        "@id": "_:t0"
+                    },
+                    {
+                        "@id": "http://ex.com/propB.2"
+                    },
+                    {
+                        "@id": "_:t4"
+                    }
+                ]
+            },
+            {
+                "@id": "_:t5"
+            },
+            {
+                "@value": "propC.2",
+                "@language": "en"
+            },
+            {
+                "@value": 30300
+            },
+            {
+                "@id": "http://ex.com/propC.4"
+            },
+            {
+                "@id": "_:t6"
+            }
+        ],
+        "http://www.example.org/shared/term": [
+            {
+                "@id": "http://ex.com/propA.1"
+            },
+            {
+                "@id": "_:t11"
+            },
+            {
+                "@value": "propA.3",
+                "@language": "de"
+            },
+            {
+                "@id": "http://ex.com/propA.4"
+            },
+            {
+                "@id": "_:t12"
+            },
+            {
+                "@value": 10600
+            },
+            {
+                "@id": "_:t16"
+            },
+            {
+                "@list": [
+                    {
+                        "@value": 20000,
+                        "@type": "http://datatype.example.org/type"
+                    },
+                    {
+                        "@value": "propB.1",
+                        "@type": "http://datatype.example.org/type"
+                    },
+                    {
+                        "@id": "_:t0"
+                    },
+                    {
+                        "@id": "http://ex.com/propB.2"
+                    },
+                    {
+                        "@id": "_:t4"
+                    }
+                ]
+            },
+            {
+                "@id": "_:t5"
+            },
+            {
+                "@value": "propC.2",
+                "@language": "en"
+            },
+            {
+                "@value": 30300
+            },
+            {
+                "@id": "http://ex.com/propC.4"
+            },
+            {
+                "@id": "_:t6"
+            }
+        ]
+    },
+    {
+        "@id": "_:t0",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "collission",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propB.2",
+        "http://example.com/vocab/nested": [
+            {
+                "@id": "_:t1"
+            },
+            {
+                "@id": "http://ex.com/propB.2.2"
+            }
+        ]
+    },
+    {
+        "@id": "_:t1",
+        "http://example.com/vocab/nested": [
+            {
+                "@value": 20110
+            },
+            {
+                "@value": "propB.2.1.1",
+                "@language": "de"
+            },
+            {
+                "@id": "http://ex.com/propB.2.1.2"
+            },
+            {
+                "@id": "_:t2"
+            }
+        ],
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propB.2.1",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propB.2.1.2"
+    },
+    {
+        "@id": "_:t2",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propB.2.1.3",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propB.2.2",
+        "http://example.com/vocab/nested": [
+            {
+                "@value": "propB.2.2.1",
+                "@language": "de"
+            },
+            {
+                "@id": "_:t3"
+            },
+            {
+                "@id": "http://ex.com/propB.2.2.3"
+            },
+            {
+                "@value": 20224
+            }
+        ]
+    },
+    {
+        "@id": "_:t3",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propB.2.2.2",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propB.2.2.3"
+    },
+    {
+        "@id": "_:t4",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propB.3",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "_:t5",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "collission",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propC.4"
+    },
+    {
+        "@id": "_:t6",
+        "http://example.com/vocab/nested": [
+            {
+                "@id": "_:t7"
+            },
+            {
+                "@id": "http://ex.com/propC.5.2"
+            }
+        ],
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propC.5",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "_:t7",
+        "http://example.com/vocab/nested": [
+            {
+                "@value": 10510
+            },
+            {
+                "@value": "propC.5.1.1",
+                "@language": "de"
+            },
+            {
+                "@id": "http://ex.com/propC.5.1.2"
+            },
+            {
+                "@id": "_:t8"
+            }
+        ],
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propC.5.1",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propC.5.1.2"
+    },
+    {
+        "@id": "_:t8",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propC.5.1.3",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propC.5.2",
+        "http://example.com/vocab/nested": [
+            {
+                "@value": "propC.5.2.1",
+                "@language": "de"
+            },
+            {
+                "@id": "_:t9"
+            },
+            {
+                "@id": "http://ex.com/propC.5.2.3"
+            },
+            {
+                "@value": 10524
+            }
+        ]
+    },
+    {
+        "@id": "_:t9",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propC.5.2.2",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propC.5.2.3"
+    },
+    {
+        "@id": "_:t10",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "collission",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propA.1"
+    },
+    {
+        "@id": "_:t11",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propA.2",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propA.4"
+    },
+    {
+        "@id": "_:t12",
+        "http://example.com/vocab/nested": [
+            {
+                "@id": "_:t13"
+            },
+            {
+                "@id": "http://ex.com/propA.5.2"
+            }
+        ],
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propA.5",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "_:t13",
+        "http://example.com/vocab/nested": [
+            {
+                "@value": 10510
+            },
+            {
+                "@value": "propA.5.1.1",
+                "@language": "de"
+            },
+            {
+                "@id": "http://ex.com/propA.5.1.2"
+            },
+            {
+                "@id": "_:t14"
+            }
+        ],
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propA.5.1",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propA.5.1.2"
+    },
+    {
+        "@id": "_:t14",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propA.5.1.3",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propA.5.2",
+        "http://example.com/vocab/nested": [
+            {
+                "@value": "propA.5.2.1",
+                "@language": "de"
+            },
+            {
+                "@id": "_:t15"
+            },
+            {
+                "@id": "http://ex.com/propA.5.2.3"
+            },
+            {
+                "@value": 10524
+            }
+        ]
+    },
+    {
+        "@id": "_:t15",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "http://ex.com/propA.5.2.2",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "http://ex.com/propA.5.2.3"
+    },
+    {
+        "@id": "_:t16",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "collission",
+                "@language": "de"
+            }
+        ]
+    },
+    {
+        "@id": "_:t17",
+        "http://example.com/vocab/term": [
+            {
+                "@value": "collission",
+                "@language": "de"
+            }
+        ]
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0040-in.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,23 @@
+{
+  "@context": {
+    "vocab": "http://example.com/vocab/",
+    "label": {
+      "@id": "vocab:label",
+      "@container": "@language"
+    },
+    "annotations": {
+      "@id": "vocab:annotation",
+      "@container": "@annotation"
+    }
+  },
+  "@id": "http://example.com/queen",
+  "label": [
+    "The Queen"
+  ],
+  "annotations":
+  [
+    "No",
+    "annotations",
+    { "@id": "asTheValueIsntAnObject" }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0040-out.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,24 @@
+[
+    {
+        "@id": "http://example.com/queen",
+        "http://example.com/vocab/annotation": [
+            {
+                "@value": "No"
+            },
+            {
+                "@value": "annotations"
+            },
+            {
+                "@id": "http://json-ld.org/test-suite/tests/asTheValueIsntAnObject"
+            }
+        ],
+        "http://example.com/vocab/label": [
+            {
+                "@value": "The Queen"
+            }
+        ]
+    },
+    {
+        "@id": "http://json-ld.org/test-suite/tests/asTheValueIsntAnObject"
+    }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-manifest.jsonld	Thu Dec 13 18:37:27 2012 +0100
@@ -0,0 +1,211 @@
+{
+  "@context": "http://json-ld.org/test-suite/context.jsonld",
+  "@id": "",
+  "@type": "jld:Manifest",
+  "rdfs:comment": "JSON-LD flatten tests use object compare",
+  "name": "flatten",
+  "baseIri": "http://json-ld.org/test-suite/tests/",
+  "sequence": [
+    {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "id",
+      "input": "flatten-0001-in.jsonld",
+      "expect": "flatten-0001-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "basic",
+      "input": "flatten-0002-in.jsonld",
+      "expect": "flatten-0002-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "drop null and unmapped properties",
+      "input": "flatten-0003-in.jsonld",
+      "expect": "flatten-0003-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "optimize @set, keep empty arrays",
+      "input": "flatten-0004-in.jsonld",
+      "expect": "flatten-0004-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "do not expand aliased @id/@type",
+      "input": "flatten-0005-in.jsonld",
+      "expect": "flatten-0005-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "alias keywords",
+      "input": "flatten-0006-in.jsonld",
+      "expect": "flatten-0006-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "date type-coercion",
+      "input": "flatten-0007-in.jsonld",
+      "expect": "flatten-0007-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "@value with @language",
+      "input": "flatten-0008-in.jsonld",
+      "expect": "flatten-0008-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "@graph with terms",
+      "input": "flatten-0009-in.jsonld",
+      "expect": "flatten-0009-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "native types",
+      "input": "flatten-0010-in.jsonld",
+      "expect": "flatten-0010-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "coerced @id",
+      "input": "flatten-0011-in.jsonld",
+      "expect": "flatten-0011-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "@graph with embed",
+      "input": "flatten-0012-in.jsonld",
+      "expect": "flatten-0012-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "flatten already expanded",
+      "input": "flatten-0013-in.jsonld",
+      "expect": "flatten-0013-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "@set of @value objects with keyword aliases",
+      "input": "flatten-0014-in.jsonld",
+      "expect": "flatten-0014-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "collapse set of sets, keep empty lists",
+      "input": "flatten-0015-in.jsonld",
+      "expect": "flatten-0015-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "context reset",
+      "input": "flatten-0016-in.jsonld",
+      "expect": "flatten-0016-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "@graph and @id aliased",
+      "input": "flatten-0017-in.jsonld",
+      "expect": "flatten-0017-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "override default @language in terms; only language-tag strings",
+      "input": "flatten-0018-in.jsonld",
+      "expect": "flatten-0018-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "remove @value = null",
+      "input": "flatten-0019-in.jsonld",
+      "expect": "flatten-0019-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "do not remove @graph if not at top-level",
+      "input": "flatten-0020-in.jsonld",
+      "expect": "flatten-0020-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "do not remove @graph at top-level if not only property",
+      "input": "flatten-0021-in.jsonld",
+      "expect": "flatten-0021-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "flatten value with default language",
+      "input": "flatten-0022-in.jsonld",
+      "expect": "flatten-0022-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Flattening lists and sets with properties having coercion coerces list/set values",
+      "input": "flatten-0023-in.jsonld",
+      "expect": "flatten-0023-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Multiple contexts",
+      "input": "flatten-0024-in.jsonld",
+      "expect": "flatten-0024-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Problematic IRI flattening tests",
+      "input": "flatten-0025-in.jsonld",
+      "expect": "flatten-0025-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Flattening term mapping to @type uses @type syntax",
+      "input": "flatten-0026-in.jsonld",
+      "expect": "flatten-0026-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Keep duplicate values in @list and @set",
+      "input": "flatten-0027-in.jsonld",
+      "expect": "flatten-0027-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Use @vocab in properties and @type but not in @id",
+      "input": "flatten-0028-in.jsonld",
+      "expect": "flatten-0028-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Relative IRIs",
+      "input": "flatten-0029-in.jsonld",
+      "expect": "flatten-0029-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Language maps",
+      "input": "flatten-0030-in.jsonld",
+      "expect": "flatten-0030-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "type-coercion of native types",
+      "input": "flatten-0031-in.jsonld",
+      "expect": "flatten-0031-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Mapping a term to null decouples it from @vocab",
+      "input": "flatten-0032-in.jsonld",
+      "expect": "flatten-0032-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Using @vocab with with type-coercion",
+      "input": "flatten-0033-in.jsonld",
+      "expect": "flatten-0033-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Multiple properties expanding to the same IRI",
+      "input": "flatten-0034-in.jsonld",
+      "expect": "flatten-0034-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Using language maps with @vocab, a default language, and a colliding property",
+      "input": "flatten-0035-in.jsonld",
+      "expect": "flatten-0035-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Flattening @annotation",
+      "input": "flatten-0036-in.jsonld",
+      "expect": "flatten-0036-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Flattening property generators (no type coercions, language mappings etc.)",
+      "input": "flatten-0037-in.jsonld",
+      "expect": "flatten-0037-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Ensure all blank nodes are relabeled when flattening.",
+      "input": "flatten-0038-in.jsonld",
+      "expect": "flatten-0038-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Complex property generator test case with multiple colliding IRIs (this document wouldn't roundtrip cleanly)",
+      "input": "flatten-0039-in.jsonld",
+      "expect": "flatten-0039-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Only invoke language and annotation map expansion if the value is a JSON object",
+      "input": "flatten-0040-in.jsonld",
+      "expect": "flatten-0040-out.jsonld"
+    }
+  ]
+}