Test @value-object optimizations
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 07 Apr 2012 01:26:00 +0800
changeset 468 37568a20ec8a
parent 467 6b87bf32c1a1
child 469 afa13fcf1b45
Test @value-object optimizations

If there's an object that has just the @language property set, it can be completely dropped, if @value is the only property, it can be replaced with @value's value.
test-suite/tests/expand-0008-in.jsonld
test-suite/tests/expand-0008-out.jsonld
--- a/test-suite/tests/expand-0008-in.jsonld	Sat Apr 07 01:07:31 2012 +0800
+++ b/test-suite/tests/expand-0008-in.jsonld	Sat Apr 07 01:26:00 2012 +0800
@@ -3,5 +3,7 @@
     "ex": "http://example.org/vocab#"
   },
   "@id": "http://example.org/test",
-  "ex:test": {"@value": "test",  "@language": "en"}
-}
\ No newline at end of file
+  "ex:test": { "@value": "test",  "@language": "en" },
+  "ex:drop-lang-only": { "@language": "en" },
+  "ex:simplify-value-only": { "@value": "only value" }
+}
--- a/test-suite/tests/expand-0008-out.jsonld	Sat Apr 07 01:07:31 2012 +0800
+++ b/test-suite/tests/expand-0008-out.jsonld	Sat Apr 07 01:26:00 2012 +0800
@@ -1,4 +1,7 @@
-[{
-  "@id": "http://example.org/test",
-  "http://example.org/vocab#test": [{"@value": "test", "@language": "en"}]
-}]
\ No newline at end of file
+[
+  {
+    "@id": "http://example.org/test",
+    "http://example.org/vocab#test": [ { "@value": "test", "@language": "en" } ],
+    "http://example.org/vocab#simplify-value-only": [ "only value" ]
+  }
+]