Remove @type in fromRDF expected results with native types
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 04 Oct 2012 12:20:07 +0200
changeset 904 2d78a631f71d
parent 903 1efc7d80e82b
child 905 ba99e5cf4282
Remove @type in fromRDF expected results with native types

When expanding, native types get expanded to an @value object but do *not* include a @type. This is required to allow compacting such an object to a scalar without having to type coerce the property. Conversion from RDF should work the same way.
test-suite/tests/fromRdf-0002-out.jsonld
test-suite/tests/fromRdf-0007-out.jsonld
--- a/test-suite/tests/fromRdf-0002-out.jsonld	Wed Oct 03 11:17:49 2012 +0200
+++ b/test-suite/tests/fromRdf-0002-out.jsonld	Thu Oct 04 12:20:07 2012 +0200
@@ -1,10 +1,12 @@
-[{
-  "@id": "http://example.com/Subj1",
-  "http://example.com/prop": [
-    {"@value": true, "@type": "http://www.w3.org/2001/XMLSchema#boolean"},
-    {"@value": false, "@type": "http://www.w3.org/2001/XMLSchema#boolean"},
-    {"@value": 1, "@type": "http://www.w3.org/2001/XMLSchema#integer"},
-    {"@value": "1.1", "@type": "http://www.w3.org/2001/XMLSchema#decimal"},
-    {"@value": 11, "@type": "http://www.w3.org/2001/XMLSchema#double"}
-  ]
-}]
\ No newline at end of file
+[
+  {
+    "@id": "http://example.com/Subj1",
+    "http://example.com/prop": [
+      { "@value": true },
+      { "@value": false },
+      { "@value": 1 },
+      { "@value": "1.1", "@type": "http://www.w3.org/2001/XMLSchema#decimal"},
+      { "@value": 11 }
+    ]
+  }
+]
--- a/test-suite/tests/fromRdf-0007-out.jsonld	Wed Oct 03 11:17:49 2012 +0200
+++ b/test-suite/tests/fromRdf-0007-out.jsonld	Thu Oct 04 12:20:07 2012 +0200
@@ -18,10 +18,9 @@
       {
         "@id": "http://en.wikipedia.org/wiki/Berlin",
         "http://data.wikipedia.org/vocab#population": [{
-          "@value": 3499879,
-          "@type": "http://www.w3.org/2001/XMLSchema#integer"
+          "@value": 3499879
         }]
       }
     ]
   }
-]
\ No newline at end of file
+]