More FromRDf use cases, including some TriG source documents for named graphs.
authorGregg Kellogg <gregg@kellogg-assoc.com>
Fri, 13 Apr 2012 16:26:49 -0700
changeset 513 e879121d9b8f
parent 512 1bac6fd73da4
child 514 1ce67e3f8570
child 515 3a05e6f7340c
More FromRDf use cases, including some TriG source documents for named graphs.
test-suite/tests/fromRdf-0004.jsonld
test-suite/tests/fromRdf-0004.ttl
test-suite/tests/fromRdf-0005.jsonld
test-suite/tests/fromRdf-0005.trig
test-suite/tests/fromRdf-0006.jsonld
test-suite/tests/fromRdf-0006.trig
test-suite/tests/fromRdf-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0004.jsonld	Fri Apr 13 16:26:49 2012 -0700
@@ -0,0 +1,16 @@
+[{
+  "@id": "http://example.com/Subj1",
+  "@type": ["http://example.com/Type"],
+  "http://example.com/literalList": {
+    "@list": [
+      {"@value": "apple"},
+      {"@value": "bananna"}
+    ]
+  },
+  "http://example.com/emptyList": {
+    "@list": []
+  },
+  "http://example.com/iriList": {
+    "@list": [{"@id": "http://example.com/iri"}]
+  }
+}]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0004.ttl	Fri Apr 13 16:26:49 2012 -0700
@@ -0,0 +1,7 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+
+ex:Subj1 a ex:Type;
+  ex:literalList ("apple" "bananna");
+  ex:emptyList ();
+  ex:iriList (<http://example.com/iri>) .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0005.jsonld	Fri Apr 13 16:26:49 2012 -0700
@@ -0,0 +1,18 @@
+[{
+  "@id": "http://example.com/U",
+  "@graph": [
+    {
+      "@id": "http://example.com/Subj1",
+      "@type": ["http://example.com/Type"],
+      "http://example.com/ref": [{"@id": "http://example.com/U"}],
+      "http://example.com/list": {
+        "@list": [
+          {"@value": "a"},
+          {"@value": "b"}
+        ]
+      }
+    }
+  ],
+  "@type": ["http://example.com/Graph"],
+  "http://example.com/name": [{"@value": "Graph"}]
+}]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0005.trig	Fri Apr 13 16:26:49 2012 -0700
@@ -0,0 +1,13 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+
+ex:U {
+  ex:Subj1 a ex:Type;
+    ex:ref ex:U;
+    ex:list ("a" "b") .
+}
+
+{
+  ex:U a ex:Graph;
+    ex:name "Graph" .
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0006.jsonld	Fri Apr 13 16:26:49 2012 -0700
@@ -0,0 +1,34 @@
+[
+  {
+    "@id": "http://example.com/U",
+    "@graph": [
+      {
+        "@id": "http://example.com/Subj1",
+        "@type": ["http://example.com/Type"],
+        "http://example.com/ref": [{"@id": "http://example.com/U"}],
+        "http://example.com/list": {
+          "@list": [
+            {"@value": "a"},
+            {"@value": "b"}
+          ]
+        }
+      }
+    ]
+  },
+  {
+    "@id": "http://example.com/V",
+    "@graph": [
+      {
+        "@id": "http://example.com/Subj1",
+        "@type": ["http://example.com/Type2"],
+        "http://example.com/ref": [{"@id": "http://example.com/V"}],
+        "http://example.com/list": {
+          "@list": [
+            {"@value": "c"},
+            {"@value": "d"}
+          ]
+        }
+      }
+    ]
+  }
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0006.trig	Fri Apr 13 16:26:49 2012 -0700
@@ -0,0 +1,14 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix ex: <http://example.com/> .
+
+ex:U {
+  ex:Subj1 a ex:Type;
+    ex:ref ex:U;
+    ex:list ("a" "b") .
+}
+
+ex:V {
+  ex:Subj1 a ex:Type2;
+    ex:ref ex:V;
+    ex:list ("c" "d") .
+}
--- a/test-suite/tests/fromRdf-manifest.jsonld	Thu Apr 12 19:44:44 2012 -0700
+++ b/test-suite/tests/fromRdf-manifest.jsonld	Fri Apr 13 16:26:49 2012 -0700
@@ -23,6 +23,24 @@
       "purpose": "BNode name generation and references between resources.",
       "input": "fromRdf-0003.ttl",
       "expect": "fromRdf-0003.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FromRDFTest"],
+      "name": "Lists",
+      "purpose": "Multiple lists with different types of element.",
+      "input": "fromRdf-0004.ttl",
+      "expect": "fromRdf-0004.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FromRDFTest"],
+      "name": "TriG document with list",
+      "purpose": "Uses a named graph containing a list.",
+      "input": "fromRdf-0005.trig",
+      "expect": "fromRdf-0005.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FromRDFTest"],
+      "name": "TriG with two graphs having same subject but different values",
+      "purpose": "Ensure that properties and list elements aren't confused between graphs.",
+      "input": "fromRdf-0006.trig",
+      "expect": "fromRdf-0006.jsonld"
     }
   ]
 }