Expand @list to arrays as everything else
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Fri, 06 Apr 2012 23:05:04 +0800
changeset 466 84ede36c082f
parent 465 b039cf8abf56
child 467 6b87bf32c1a1
Expand @list to arrays as everything else

@list objects are now expanded to arrays as everything else. It is still an open question whether we wanna just allow one list per property or not (see #92). Currently we don't restrict it and so the result should be an array.
test-suite/tests/expand-0004-out.jsonld
test-suite/tests/expand-0015-out.jsonld
test-suite/tests/expand-0016-out.jsonld
--- a/test-suite/tests/expand-0004-out.jsonld	Fri Apr 06 22:55:35 2012 +0800
+++ b/test-suite/tests/expand-0004-out.jsonld	Fri Apr 06 23:05:04 2012 +0800
@@ -1,12 +1,12 @@
 [{
   "@id": "http://example.org/id",
-  "http://example.com/mylist1": {"@list": []},
+  "http://example.com/mylist1": [ {"@list": []} ],
   "http://example.com/myset2": [],
   "http://example.com/myset3": ["v1"],
-  "http://example.org/list1": {"@list": []},
-  "http://example.org/list2": {"@list": []},
+  "http://example.org/list1": [ {"@list": []} ],
+  "http://example.org/list2": [ {"@list": []} ],
   "http://example.org/set1": [],
   "http://example.org/set1": [],
   "http://example.org/set3": [],
   "http://example.org/set4": []
-}]
\ No newline at end of file
+}]
--- a/test-suite/tests/expand-0015-out.jsonld	Fri Apr 06 22:55:35 2012 +0800
+++ b/test-suite/tests/expand-0015-out.jsonld	Fri Apr 06 23:05:04 2012 +0800
@@ -1,7 +1,7 @@
 [
   {
     "@id": "http://example.org/id",
-    "http://example.com/mylist1": { "@list": [] },
+    "http://example.com/mylist1": [ { "@list": [] } ],
     "http://example.com/myset1": [ ],
     "http://example.com/myset2": [ ],
     "http://example.com/myset3": [ "hello", "this", "will", "be", "collapsed" ]
--- a/test-suite/tests/expand-0016-out.jsonld	Fri Apr 06 22:55:35 2012 +0800
+++ b/test-suite/tests/expand-0016-out.jsonld	Fri Apr 06 23:05:04 2012 +0800
@@ -1,8 +1,8 @@
 [
   {
     "@id": "http://example.org/id1",
-    "http://example.com/mylist1": { "@list": [] },
-    "http://example.com/mylist2": { "@list": [ 2, "hi" ] },
+    "http://example.com/mylist1": [ { "@list": [] } ],
+    "http://example.com/mylist2": [ { "@list": [ 2, "hi" ] } ],
     "http://example.com/myset1": [ ],
     "http://example.com/myset2": [ ],
     "http://example.com/myproperty": [