Improve compact-0023
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 08 Dec 2012 23:02:11 +0100
changeset 1010 4f19d65d2f3a
parent 1009 ee4c2b0940a4
child 1011 e6a52dc0ea84
Improve compact-0023

If @vocab is set to http://example.com/subdir/ and there's a term definition vocab/date then the datatype http://example.com/subdir/vocab/dateTime is compacted to vocab/date:Time which is more than surprising when debugging. Change the IRIs of the datatypes to http://example.com/subdir/vocab/types/...
test-suite/tests/compact-0023-context.jsonld
test-suite/tests/compact-0023-in.jsonld
test-suite/tests/compact-0023-out.jsonld
--- a/test-suite/tests/compact-0023-context.jsonld	Sat Dec 08 22:31:49 2012 +0100
+++ b/test-suite/tests/compact-0023-context.jsonld	Sat Dec 08 23:02:11 2012 +0100
@@ -2,6 +2,6 @@
   "@context": {
     "@vocab": "http://example.com/subdir/",
     "ex": "http://example.com/",
-    "ex:subdir/vocab/date": { "@type": "vocab/dateTime" }
+    "ex:subdir/vocab/date": { "@type": "vocab/types/dateTime" }
   }
 }
--- a/test-suite/tests/compact-0023-in.jsonld	Sat Dec 08 22:31:49 2012 +0100
+++ b/test-suite/tests/compact-0023-in.jsonld	Sat Dec 08 23:02:11 2012 +0100
@@ -1,11 +1,11 @@
 [
   {
     "@id": "http://example.com/subdir/id/1",
-    "@type": [ "http://example.com/subdir/vocab/Test" ],
+    "@type": [ "http://example.com/subdir/vocab/types/Test" ],
     "http://example.com/subdir/vocab/date": [
       {
         "@value": "2011-01-25T00:00:00Z",
-        "@type": "http://example.com/subdir/vocab/dateTime"
+        "@type": "http://example.com/subdir/vocab/types/dateTime"
       }
     ],
     "http://example.com/subdir/vocab/embed": [
@@ -14,7 +14,7 @@
         "http://example.com/subdir/vocab/expandedDate": [
           {
             "@value": "2012-08-01T00:00:00Z",
-            "@type": "http://example.com/subdir/vocab/dateTime"
+            "@type": "http://example.com/subdir/vocab/types/dateTime"
           }
         ]
       }
--- a/test-suite/tests/compact-0023-out.jsonld	Sat Dec 08 22:31:49 2012 +0100
+++ b/test-suite/tests/compact-0023-out.jsonld	Sat Dec 08 23:02:11 2012 +0100
@@ -2,16 +2,16 @@
   "@context": {
     "@vocab": "http://example.com/subdir/",
     "ex": "http://example.com/",
-    "ex:subdir/vocab/date": { "@type": "vocab/dateTime" }
+    "ex:subdir/vocab/date": { "@type": "vocab/types/dateTime" }
   },
   "@id": "ex:subdir/id/1",
-  "@type": "ex:subdir/vocab/Test",
+  "@type": "ex:subdir/vocab/types/Test",
   "ex:subdir/vocab/date": "2011-01-25T00:00:00Z",
   "ex:subdir/vocab/embed": {
     "@id": "ex:subdir/id/2",
     "ex:subdir/vocab/expandedDate": {
       "@value": "2012-08-01T00:00:00Z",
-      "@type": "ex:subdir/vocab/dateTime"
+      "@type": "ex:subdir/vocab/types/dateTime"
     }
   }
 }