Added compact-0016 and updated expand-0021 to deal with recursive graph definitions, and to ensure that plain strings are properly expanded-to or compacted-from subject references.
authorGregg Kellogg <gregg@kellogg-assoc.com>
Tue, 24 Apr 2012 13:07:58 -0700
changeset 568 bd8ca88805bd
parent 567 aab8d2b60a51
child 569 0720bb200616
Added compact-0016 and updated expand-0021 to deal with recursive graph definitions, and to ensure that plain strings are properly expanded-to or compacted-from subject references.
test-suite/tests/compact-0016-context.jsonld
test-suite/tests/compact-0016-in.jsonld
test-suite/tests/compact-0016-out.jsonld
test-suite/tests/compact-manifest.jsonld
test-suite/tests/expand-0021-in.jsonld
test-suite/tests/expand-0021-out.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0016-context.jsonld	Tue Apr 24 13:07:58 2012 -0700
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "wd": "http://data.wikipedia.org/vocab#",
+    "ws": "http://data.wikipedia.org/snaks/",
+    "wp": "http://en.wikipedia.org/wiki/"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0016-in.jsonld	Tue Apr 24 13:07:58 2012 -0700
@@ -0,0 +1,19 @@
+[
+  {
+    "@id": "http://data.wikipedia.org/snaks/Assertions",
+    "@type": ["http://data.wikipedia.org/vocab#SnakSet"],
+    "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://gregkellogg.net/foaf#me"}
+    ],
+    "@graph": [{
+      "@id": "http://data.wikipedia.org/snaks/BerlinFact",
+      "@type": ["http://data.wikipedia.org/vocab#Snak"],
+      "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://www.statistik-berlin-brandenburg.de/"}],
+      "@graph": [{
+        "@id": "http://en.wikipedia.org/wiki/Berlin",
+        "http://data.wikipedia.org/vocab#population": [3499879]
+      }, {
+        "@id": "http://data.wikipedia.org/snaks/ParisFact"
+      }]
+    }]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0016-out.jsonld	Tue Apr 24 13:07:58 2012 -0700
@@ -0,0 +1,22 @@
+{
+  "@context": {
+    "wd": "http://data.wikipedia.org/vocab#",
+    "ws": "http://data.wikipedia.org/snaks/",
+    "wp": "http://en.wikipedia.org/wiki/"
+  },
+  "@id": "ws:Assertions",
+  "@type": "wd:SnakSet",
+  "@graph": {
+    "@id": "ws:BerlinFact",
+    "@type": "wd:Snak",
+    "@graph": [
+      {
+        "@id": "wp:Berlin",
+        "wd:population": 3499879
+      },
+      "ws:ParisFact"
+    ],
+    "wd:assertedBy": "http://www.statistik-berlin-brandenburg.de/"
+  },
+  "wd:assertedBy": "http://gregkellogg.net/foaf#me"
+}
\ No newline at end of file
--- a/test-suite/tests/compact-manifest.jsonld	Tue Apr 24 12:32:33 2012 -0700
+++ b/test-suite/tests/compact-manifest.jsonld	Tue Apr 24 13:07:58 2012 -0700
@@ -95,5 +95,11 @@
     "input": "compact-0015-in.jsonld",
     "context": "compact-0015-context.jsonld",
     "expect": "compact-0015-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "recursive named graphs",
+    "input": "compact-0016-in.jsonld",
+    "context": "compact-0016-context.jsonld",
+    "expect": "compact-0016-out.jsonld"
   }]
 }
--- a/test-suite/tests/expand-0021-in.jsonld	Tue Apr 24 12:32:33 2012 -0700
+++ b/test-suite/tests/expand-0021-in.jsonld	Tue Apr 24 13:07:58 2012 -0700
@@ -31,7 +31,8 @@
             "@id": "http://example.org/test#chapter2",
             "description": "More fun",
             "title": "Chapter Two"
-          }
+          },
+          "http://example.org/test#chapter3"
         ]
       }
     },
--- a/test-suite/tests/expand-0021-out.jsonld	Tue Apr 24 12:32:33 2012 -0700
+++ b/test-suite/tests/expand-0021-out.jsonld	Tue Apr 24 13:07:58 2012 -0700
@@ -17,7 +17,8 @@
                 "@id": "http://example.org/test#chapter2",
                 "http://purl.org/dc/elements/1.1/description": [ "More fun" ],
                 "http://purl.org/dc/elements/1.1/title": [ "Chapter Two" ]
-              }
+              },
+              {"@id": "http://example.org/test#chapter3"}
             ]
           }
         ]