diff --git a/tests/compact-manifest.html b/tests/compact-manifest.html index 6e453394..546105f2 100644 --- a/tests/compact-manifest.html +++ b/tests/compact-manifest.html @@ -4805,6 +4805,38 @@ <h2> </dd> </dl> </dd> + <dt id='tej01'> + Test tej01 Multiple JSON values for a JSON literal properties + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tej01</dd> + <dt>Type</dt> + <dd>jld:NegativeEvaluationTest, jld:CompactTest</dd> + <dt>Purpose</dt> + <dd>Tests compacting multiple JSON values for a JSON literal property.</dd> + <dt>input</dt> + <dd> + <a href='compact/ej01-in.jsonld'>compact/ej01-in.jsonld</a> + </dd> + <dt>context</dt> + <dd> + <a href='compact/ej01-context.jsonld'>compact/ej01-context.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + multiple JSON literals + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> <dt id='tin01'> Test tin01 Basic Included array </dt> @@ -5317,6 +5349,166 @@ <h2> </dd> </dl> </dd> + <dt id='tjs12'> + Test tjs12 Compact JSON literal (empty array) + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs12</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:CompactTest</dd> + <dt>Purpose</dt> + <dd>Tests compacting property with @type @json to a JSON literal (empty array).</dd> + <dt>input</dt> + <dd> + <a href='compact/js12-in.jsonld'>compact/js12-in.jsonld</a> + </dd> + <dt>context</dt> + <dd> + <a href='compact/js12-context.jsonld'>compact/js12-context.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='compact/js12-out.jsonld'>compact/js12-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs13'> + Test tjs13 Compact JSON literal (array with string) + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs13</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:CompactTest</dd> + <dt>Purpose</dt> + <dd>Tests compacting property with @type @json to a JSON literal (array with string).</dd> + <dt>input</dt> + <dd> + <a href='compact/js13-in.jsonld'>compact/js13-in.jsonld</a> + </dd> + <dt>context</dt> + <dd> + <a href='compact/js13-context.jsonld'>compact/js13-context.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='compact/js13-out.jsonld'>compact/js13-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs14'> + Test tjs14 Compact JSON literal and non-JSON with @json property + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs14</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:CompactTest</dd> + <dt>Purpose</dt> + <dd>Tests compacting property with @type @json with JSON literal and non-JSON.</dd> + <dt>input</dt> + <dd> + <a href='compact/js14-in.jsonld'>compact/js14-in.jsonld</a> + </dd> + <dt>context</dt> + <dd> + <a href='compact/js14-context.jsonld'>compact/js14-context.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='compact/js14-out.jsonld'>compact/js14-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs15'> + Test tjs15 Compact JSON literal and non-JSON without @json property + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs15</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:CompactTest</dd> + <dt>Purpose</dt> + <dd>Tests compacting property without @type @json with JSON literal and non-JSON.</dd> + <dt>input</dt> + <dd> + <a href='compact/js15-in.jsonld'>compact/js15-in.jsonld</a> + </dd> + <dt>context</dt> + <dd> + <a href='compact/js15-context.jsonld'>compact/js15-context.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='compact/js15-out.jsonld'>compact/js15-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs16'> + Test tjs16 Compact JSON literal and non-JSON with and without @json property + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs16</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:CompactTest</dd> + <dt>Purpose</dt> + <dd>Tests compacting property with and without @type @json with JSON literal and non-JSON.</dd> + <dt>input</dt> + <dd> + <a href='compact/js16-in.jsonld'>compact/js16-in.jsonld</a> + </dd> + <dt>context</dt> + <dd> + <a href='compact/js16-context.jsonld'>compact/js16-context.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='compact/js16-out.jsonld'>compact/js16-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> <dt id='tla01'> Test tla01 most specific term matching in @list. </dt> diff --git a/tests/compact-manifest.jsonld b/tests/compact-manifest.jsonld index 0743df70..c5d9c4e4 100644 --- a/tests/compact-manifest.jsonld +++ b/tests/compact-manifest.jsonld @@ -1405,6 +1405,15 @@ "input": "compact/ep15-in.jsonld", "context": "compact/ep15-context.jsonld", "expectErrorCode": "invalid container mapping" + }, { + "@id": "#tej01", + "@type": ["jld:NegativeEvaluationTest", "jld:CompactTest"], + "name": "Multiple JSON values for a JSON literal properties", + "purpose": "Tests compacting multiple JSON values for a JSON literal property.", + "input": "compact/ej01-in.jsonld", + "context": "compact/ej01-context.jsonld", + "expectErrorCode": "multiple JSON literals", + "option": {"specVersion": "json-ld-1.1"} }, { "@id": "#tin01", "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], @@ -1549,6 +1558,51 @@ "context": "compact/js11-context.jsonld", "expect": "compact/js11-out.jsonld", "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs12", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Compact JSON literal (empty array)", + "purpose": "Tests compacting property with @type @json to a JSON literal (empty array).", + "input": "compact/js12-in.jsonld", + "context": "compact/js12-context.jsonld", + "expect": "compact/js12-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs13", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Compact JSON literal (array with string)", + "purpose": "Tests compacting property with @type @json to a JSON literal (array with string).", + "input": "compact/js13-in.jsonld", + "context": "compact/js13-context.jsonld", + "expect": "compact/js13-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs14", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Compact JSON literal and non-JSON with @json property", + "purpose": "Tests compacting property with @type @json with JSON literal and non-JSON.", + "input": "compact/js14-in.jsonld", + "context": "compact/js14-context.jsonld", + "expect": "compact/js14-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs15", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Compact JSON literal and non-JSON without @json property", + "purpose": "Tests compacting property without @type @json with JSON literal and non-JSON.", + "input": "compact/js15-in.jsonld", + "context": "compact/js15-context.jsonld", + "expect": "compact/js15-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs16", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "Compact JSON literal and non-JSON with and without @json property", + "purpose": "Tests compacting property with and without @type @json with JSON literal and non-JSON.", + "input": "compact/js16-in.jsonld", + "context": "compact/js16-context.jsonld", + "expect": "compact/js16-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} }, { "@id": "#tla01", "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], diff --git a/tests/compact/ej01-context.jsonld b/tests/compact/ej01-context.jsonld new file mode 100644 index 00000000..46787e1d --- /dev/null +++ b/tests/compact/ej01-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value", "@type": "@json"} + } +} diff --git a/tests/compact/ej01-in.jsonld b/tests/compact/ej01-in.jsonld new file mode 100644 index 00000000..590f51ae --- /dev/null +++ b/tests/compact/ej01-in.jsonld @@ -0,0 +1,9 @@ +[{ + "http://example.org/vocab#value": [{ + "@value": ["JSON1"], + "@type": "@json" + }, { + "@value": ["JSON2"], + "@type": "@json" + }] +}] diff --git a/tests/compact/js07-out.jsonld b/tests/compact/js07-out.jsonld index d4e7c2cb..bd557c0b 100644 --- a/tests/compact/js07-out.jsonld +++ b/tests/compact/js07-out.jsonld @@ -3,5 +3,5 @@ "@version": 1.1, "e": {"@id": "http://example.org/vocab#array", "@type": "@json", "@container": "@set"} }, - "e": [{"foo": "bar"}] -} \ No newline at end of file + "e": [[{"foo": "bar"}]] +} diff --git a/tests/compact/js12-context.jsonld b/tests/compact/js12-context.jsonld new file mode 100644 index 00000000..46787e1d --- /dev/null +++ b/tests/compact/js12-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value", "@type": "@json"} + } +} diff --git a/tests/compact/js12-in.jsonld b/tests/compact/js12-in.jsonld new file mode 100644 index 00000000..33e2be76 --- /dev/null +++ b/tests/compact/js12-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#value": [{ + "@value": ["string"], + "@type": "@json" + }] +}] diff --git a/tests/compact/js12-out.jsonld b/tests/compact/js12-out.jsonld new file mode 100644 index 00000000..2e680bce --- /dev/null +++ b/tests/compact/js12-out.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value", "@type": "@json"} + }, + "e": ["string"] +} diff --git a/tests/compact/js13-context.jsonld b/tests/compact/js13-context.jsonld new file mode 100644 index 00000000..46787e1d --- /dev/null +++ b/tests/compact/js13-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value", "@type": "@json"} + } +} diff --git a/tests/compact/js13-in.jsonld b/tests/compact/js13-in.jsonld new file mode 100644 index 00000000..6cdd158e --- /dev/null +++ b/tests/compact/js13-in.jsonld @@ -0,0 +1,6 @@ +[{ + "http://example.org/vocab#value": [{ + "@value": [], + "@type": "@json" + }] +}] diff --git a/tests/compact/js13-out.jsonld b/tests/compact/js13-out.jsonld new file mode 100644 index 00000000..4b889432 --- /dev/null +++ b/tests/compact/js13-out.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value", "@type": "@json"} + }, + "e": [] +} diff --git a/tests/compact/js14-context.jsonld b/tests/compact/js14-context.jsonld new file mode 100644 index 00000000..46787e1d --- /dev/null +++ b/tests/compact/js14-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value", "@type": "@json"} + } +} diff --git a/tests/compact/js14-in.jsonld b/tests/compact/js14-in.jsonld new file mode 100644 index 00000000..9255f815 --- /dev/null +++ b/tests/compact/js14-in.jsonld @@ -0,0 +1,8 @@ +[{ + "http://example.org/vocab#value": [{ + "@value": [], + "@type": "@json" + }, + "non-JSON" + ] +}] diff --git a/tests/compact/js14-out.jsonld b/tests/compact/js14-out.jsonld new file mode 100644 index 00000000..6ef179b8 --- /dev/null +++ b/tests/compact/js14-out.jsonld @@ -0,0 +1,8 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value", "@type": "@json"} + }, + "e": [], + "http://example.org/vocab#value": "non-JSON" +} diff --git a/tests/compact/js15-context.jsonld b/tests/compact/js15-context.jsonld new file mode 100644 index 00000000..96b097d0 --- /dev/null +++ b/tests/compact/js15-context.jsonld @@ -0,0 +1,6 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value"} + } +} diff --git a/tests/compact/js15-in.jsonld b/tests/compact/js15-in.jsonld new file mode 100644 index 00000000..9255f815 --- /dev/null +++ b/tests/compact/js15-in.jsonld @@ -0,0 +1,8 @@ +[{ + "http://example.org/vocab#value": [{ + "@value": [], + "@type": "@json" + }, + "non-JSON" + ] +}] diff --git a/tests/compact/js15-out.jsonld b/tests/compact/js15-out.jsonld new file mode 100644 index 00000000..fd291ac2 --- /dev/null +++ b/tests/compact/js15-out.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "http://example.org/vocab#value"} + }, + "e": [ + { + "@type": "@json", + "@value": [] + }, + "non-JSON" + ] +} diff --git a/tests/compact/js16-context.jsonld b/tests/compact/js16-context.jsonld new file mode 100644 index 00000000..6a0627d9 --- /dev/null +++ b/tests/compact/js16-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e-json": {"@id": "http://example.org/vocab#value", "@type": "@json"}, + "e-non-json": {"@id": "http://example.org/vocab#value"} + } +} diff --git a/tests/compact/js16-in.jsonld b/tests/compact/js16-in.jsonld new file mode 100644 index 00000000..9255f815 --- /dev/null +++ b/tests/compact/js16-in.jsonld @@ -0,0 +1,8 @@ +[{ + "http://example.org/vocab#value": [{ + "@value": [], + "@type": "@json" + }, + "non-JSON" + ] +}] diff --git a/tests/compact/js16-out.jsonld b/tests/compact/js16-out.jsonld new file mode 100644 index 00000000..e2f6fb89 --- /dev/null +++ b/tests/compact/js16-out.jsonld @@ -0,0 +1,9 @@ +{ + "@context": { + "@version": 1.1, + "e-json": {"@id": "http://example.org/vocab#value", "@type": "@json"}, + "e-non-json": {"@id": "http://example.org/vocab#value"} + }, + "e-json": [], + "e-non-json": "non-JSON" +} diff --git a/tests/expand-manifest.html b/tests/expand-manifest.html index 85a273e9..35df2f1f 100644 --- a/tests/expand-manifest.html +++ b/tests/expand-manifest.html @@ -6025,6 +6025,69 @@ <h2> </dd> </dl> </dd> + <dt id='ter57'> + Test ter57 Array not found for @json @set. + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#ter57</dd> + <dt>Type</dt> + <dd>jld:NegativeEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>The value for a @json @set term MUST be an array.</dd> + <dt>input</dt> + <dd> + <a href='expand/er57-in.jsonld'>expand/er57-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + invalid set or list object + </dd> + </dl> + </dd> + <dt id='ter58'> + Test ter58 Array not found for @json @set. + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#ter58</dd> + <dt>Type</dt> + <dd>jld:NegativeEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>The value for a @json @set term MUST be an array.</dd> + <dt>input</dt> + <dd> + <a href='expand/er57-in.jsonld'>expand/er57-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + invalid set or list object + </dd> + </dl> + </dd> + <dt id='ter58'> + Test ter58 Array not found for @json @list. + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#ter58</dd> + <dt>Type</dt> + <dd>jld:NegativeEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>The value for a @json @list term MUST be an array.</dd> + <dt>input</dt> + <dd> + <a href='expand/er58-in.jsonld'>expand/er58-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + invalid set or list object + </dd> + </dl> + </dd> <dt id='tes01'> Test tes01 Using an array value for @context is illegal in JSON-LD 1.0 </dt> @@ -6979,6 +7042,202 @@ <h2> </dd> </dl> </dd> + <dt id='tjs24'> + Test tjs24 Expand JSON literal (one JSON literal). + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs24</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>Tests expanding property with @type @json (one JSON literal).</dd> + <dt>input</dt> + <dd> + <a href='expand/js24-in.jsonld'>expand/js24-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='expand/js24-out.jsonld'>expand/js24-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs25'> + Test tjs25 Expand JSON literal (two JSON literals). + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs25</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>Tests expanding property with @type @json (two JSON literals).</dd> + <dt>input</dt> + <dd> + <a href='expand/js25-in.jsonld'>expand/js25-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='expand/js25-out.jsonld'>expand/js25-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs26'> + Test tjs26 Expand JSON literal (JSON literal and non-JSON). + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs26</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>Tests expanding property with @type @json (JSON literal and non-JSON).</dd> + <dt>input</dt> + <dd> + <a href='expand/js26-in.jsonld'>expand/js26-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='expand/js26-out.jsonld'>expand/js26-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs27'> + Test tjs27 Expand JSON literal (duplicate JSON literals). + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs27</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>Tests expanding property with @type @json (dupcliate JSON literals).</dd> + <dt>input</dt> + <dd> + <a href='expand/js27-in.jsonld'>expand/js27-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='expand/js27-out.jsonld'>expand/js27-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs28'> + Test tjs28 Expand array-like value with @json and no @set/@list in @context. + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs28</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>Tests expanding array-like value with @json and no @set/@list in @context.</dd> + <dt>input</dt> + <dd> + <a href='expand/js28-in.jsonld'>expand/js28-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='expand/js28-out.jsonld'>expand/js28-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs29'> + Test tjs29 Expand array-like value with @json and @set in @context. + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs29</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>Tests expanding array-like value with @json and @set in @context.</dd> + <dt>input</dt> + <dd> + <a href='expand/js29-in.jsonld'>expand/js29-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='expand/js29-out.jsonld'>expand/js29-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs30'> + Test tjs30 Expand array-like value with @json and @list in @context. + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs30</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd> + <dt>Purpose</dt> + <dd>Tests expanding array-like value with @json and @list in @context.</dd> + <dt>input</dt> + <dd> + <a href='expand/js30-in.jsonld'>expand/js30-in.jsonld</a> + </dd> + <dt>expect</dt> + <dd> + <a href='expand/js30-out.jsonld'>expand/js30-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> <dt id='tl001'> Test tl001 Language map with null value </dt> diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index 12cb3993..79be31a2 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -1826,6 +1826,27 @@ "purpose": "Verifies that an exception is raised when attempting to redefine @context.", "input": "expand/er56-in.jsonld", "expectErrorCode": "keyword redefinition" + }, { + "@id": "#ter57", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Array not found for @json @set.", + "purpose": "The value for a @json @set term MUST be an array.", + "input": "expand/er57-in.jsonld", + "expectErrorCode": "invalid set or list object" + }, { + "@id": "#ter58", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Array not found for @json @set.", + "purpose": "The value for a @json @set term MUST be an array.", + "input": "expand/er57-in.jsonld", + "expectErrorCode": "invalid set or list object" + }, { + "@id": "#ter58", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Array not found for @json @list.", + "purpose": "The value for a @json @list term MUST be an array.", + "input": "expand/er58-in.jsonld", + "expectErrorCode": "invalid set or list object" }, { "@id": "#tes01", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], @@ -2098,6 +2119,62 @@ "input": "expand/js23-in.jsonld", "expect": "expand/js23-out.jsonld", "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs24", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expand JSON literal (one JSON literal).", + "purpose": "Tests expanding property with @type @json (one JSON literal).", + "input": "expand/js24-in.jsonld", + "expect": "expand/js24-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs25", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expand JSON literal (two JSON literals).", + "purpose": "Tests expanding property with @type @json (two JSON literals).", + "input": "expand/js25-in.jsonld", + "expect": "expand/js25-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs26", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expand JSON literal (JSON literal and non-JSON).", + "purpose": "Tests expanding property with @type @json (JSON literal and non-JSON).", + "input": "expand/js26-in.jsonld", + "expect": "expand/js26-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs27", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expand JSON literal (duplicate JSON literals).", + "purpose": "Tests expanding property with @type @json (dupcliate JSON literals).", + "input": "expand/js27-in.jsonld", + "expect": "expand/js27-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs28", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expand array-like value with @json and no @set/@list in @context.", + "purpose": "Tests expanding array-like value with @json and no @set/@list in @context.", + "input": "expand/js28-in.jsonld", + "expect": "expand/js28-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs29", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expand array-like value with @json and @set in @context.", + "purpose": "Tests expanding array-like value with @json and @set in @context.", + "input": "expand/js29-in.jsonld", + "expect": "expand/js29-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs30", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Expand array-like value with @json and @list in @context.", + "purpose": "Tests expanding array-like value with @json and @list in @context.", + "input": "expand/js30-in.jsonld", + "expect": "expand/js30-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} }, { "@id": "#tl001", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], diff --git a/tests/expand/er57-in.jsonld b/tests/expand/er57-in.jsonld new file mode 100644 index 00000000..07e6339b --- /dev/null +++ b/tests/expand/er57-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "prop": { + "@id": "ex:prop", + "@type": "@json", + "@container": "@set" + } + }, + "prop": "value" +} diff --git a/tests/expand/er58-in.jsonld b/tests/expand/er58-in.jsonld new file mode 100644 index 00000000..90091bf2 --- /dev/null +++ b/tests/expand/er58-in.jsonld @@ -0,0 +1,11 @@ +{ + "@context": { + "prop": { + "@id": "ex:prop", + "@type": "@json", + "@container": "@list" + } + }, + "prop": "value" +} + diff --git a/tests/expand/js24-in.jsonld b/tests/expand/js24-in.jsonld new file mode 100644 index 00000000..e62286bf --- /dev/null +++ b/tests/expand/js24-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#null": {"@value": ["JSON"], "@type": "@json"} +} diff --git a/tests/expand/js24-out.jsonld b/tests/expand/js24-out.jsonld new file mode 100644 index 00000000..a0a7348b --- /dev/null +++ b/tests/expand/js24-out.jsonld @@ -0,0 +1,8 @@ +[{ + "http://example.org/vocab#null": [{ + "@type": "@json", + "@value": [ + "JSON" + ] + }] +}] diff --git a/tests/expand/js25-in.jsonld b/tests/expand/js25-in.jsonld new file mode 100644 index 00000000..84ff724c --- /dev/null +++ b/tests/expand/js25-in.jsonld @@ -0,0 +1,6 @@ +{ + "http://example.org/vocab#value": [ + {"@value": ["JSON1"], "@type": "@json"}, + {"@value": ["JSON2"], "@type": "@json"} + ] +} diff --git a/tests/expand/js25-out.jsonld b/tests/expand/js25-out.jsonld new file mode 100644 index 00000000..6e6ff887 --- /dev/null +++ b/tests/expand/js25-out.jsonld @@ -0,0 +1,13 @@ +[{ + "http://example.org/vocab#value": [{ + "@type": "@json", + "@value": [ + "JSON1" + ] + }, { + "@type": "@json", + "@value": [ + "JSON2" + ] + }] +}] diff --git a/tests/expand/js26-in.jsonld b/tests/expand/js26-in.jsonld new file mode 100644 index 00000000..3f11042f --- /dev/null +++ b/tests/expand/js26-in.jsonld @@ -0,0 +1,6 @@ +{ + "http://example.org/vocab#value": [ + {"@value": ["JSON"], "@type": "@json"}, + {"@value": "non-JSON"} + ] +} diff --git a/tests/expand/js26-out.jsonld b/tests/expand/js26-out.jsonld new file mode 100644 index 00000000..6251d232 --- /dev/null +++ b/tests/expand/js26-out.jsonld @@ -0,0 +1,10 @@ +[{ + "http://example.org/vocab#value": [{ + "@type": "@json", + "@value": [ + "JSON" + ] + }, { + "@value": "non-JSON" + }] +}] diff --git a/tests/expand/js27-in.jsonld b/tests/expand/js27-in.jsonld new file mode 100644 index 00000000..9d479f74 --- /dev/null +++ b/tests/expand/js27-in.jsonld @@ -0,0 +1,6 @@ +{ + "http://example.org/vocab#value": [ + {"@value": ["dup"], "@type": "@json"}, + {"@value": ["dup"], "@type": "@json"} + ] +} diff --git a/tests/expand/js27-out.jsonld b/tests/expand/js27-out.jsonld new file mode 100644 index 00000000..5e15b03c --- /dev/null +++ b/tests/expand/js27-out.jsonld @@ -0,0 +1,13 @@ +[{ + "http://example.org/vocab#value": [{ + "@type": "@json", + "@value": [ + "dup" + ] + }, { + "@type": "@json", + "@value": [ + "dup" + ] + }] +}] diff --git a/tests/expand/js28-in.jsonld b/tests/expand/js28-in.jsonld new file mode 100644 index 00000000..8a10ef58 --- /dev/null +++ b/tests/expand/js28-in.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "ex:e", "@type": "@json"} + }, + "e": ["v1", "v2"] +} diff --git a/tests/expand/js28-out.jsonld b/tests/expand/js28-out.jsonld new file mode 100644 index 00000000..48880690 --- /dev/null +++ b/tests/expand/js28-out.jsonld @@ -0,0 +1,13 @@ +[ + { + "ex:e": [ + { + "@type": "@json", + "@value": [ + "v1", + "v2" + ] + } + ] + } +] diff --git a/tests/expand/js29-in.jsonld b/tests/expand/js29-in.jsonld new file mode 100644 index 00000000..a06649ee --- /dev/null +++ b/tests/expand/js29-in.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "ex:e", "@type": "@json", "@container": "@set"} + }, + "e": ["v1", "v2"] +} diff --git a/tests/expand/js29-out.jsonld b/tests/expand/js29-out.jsonld new file mode 100644 index 00000000..55f2348b --- /dev/null +++ b/tests/expand/js29-out.jsonld @@ -0,0 +1,14 @@ +[ + { + "ex:e": [ + { + "@type": "@json", + "@value": "v1" + }, + { + "@type": "@json", + "@value": "v2" + } + ] + } +] diff --git a/tests/expand/js30-in.jsonld b/tests/expand/js30-in.jsonld new file mode 100644 index 00000000..aaa153d2 --- /dev/null +++ b/tests/expand/js30-in.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "ex:e", "@type": "@json", "@container": "@list"} + }, + "e": ["v1", "v2"] +} diff --git a/tests/expand/js30-out.jsonld b/tests/expand/js30-out.jsonld new file mode 100644 index 00000000..47e6e973 --- /dev/null +++ b/tests/expand/js30-out.jsonld @@ -0,0 +1,18 @@ +[ + { + "ex:e": [ + { + "@list": [ + { + "@type": "@json", + "@value": "v1" + }, + { + "@type": "@json", + "@value": "v2" + } + ] + } + ] + } +] diff --git a/tests/fromRdf-manifest.html b/tests/fromRdf-manifest.html index ca803b4b..b0128020 100644 --- a/tests/fromRdf-manifest.html +++ b/tests/fromRdf-manifest.html @@ -1324,6 +1324,62 @@ <h2> </dd> </dl> </dd> + <dt id='tjs12'> + Test tjs12 JSON literals (strings) + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs12</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:FromRDFTest</dd> + <dt>Purpose</dt> + <dd>Tests creating property with multiple rdf:type rdf:JSON to a JSON literal (null).</dd> + <dt>input</dt> + <dd> + <a href='fromRdf/js12-in.nq'>fromRdf/js12-in.nq</a> + </dd> + <dt>expect</dt> + <dd> + <a href='fromRdf/js12-out.jsonld'>fromRdf/js12-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> + <dt id='tjs13'> + Test tjs13 Mixed JSON literals and non-JSON + </dt> + <dd> + <dl class='entry'> + <dt>id</dt> + <dd>#tjs13</dd> + <dt>Type</dt> + <dd>jld:PositiveEvaluationTest, jld:FromRDFTest</dd> + <dt>Purpose</dt> + <dd>Tests creating property with mixed rdf:type rdf:JSON and non-JSON.</dd> + <dt>input</dt> + <dd> + <a href='fromRdf/js13-in.nq'>fromRdf/js13-in.nq</a> + </dd> + <dt>expect</dt> + <dd> + <a href='fromRdf/js13-out.jsonld'>fromRdf/js13-out.jsonld</a> + </dd> + <dt>Options</dt> + <dd> + <dl class='options'> + <dt>specVersion</dt> + <dd>json-ld-1.1</dd> + </dl> + </dd> + </dl> + </dd> <dt id='tli01'> Test tli01 @list containing empty @list </dt> diff --git a/tests/fromRdf-manifest.jsonld b/tests/fromRdf-manifest.jsonld index 1764a682..90c8cadf 100644 --- a/tests/fromRdf-manifest.jsonld +++ b/tests/fromRdf-manifest.jsonld @@ -379,6 +379,22 @@ "input": "fromRdf/js11-in.nq", "expect": "fromRdf/js11-out.jsonld", "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs12", + "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], + "name": "JSON literals (strings)", + "purpose": "Tests creating property with multiple rdf:type rdf:JSON to a JSON literal (null).", + "input": "fromRdf/js12-in.nq", + "expect": "fromRdf/js12-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs13", + "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], + "name": "Mixed JSON literals and non-JSON", + "purpose": "Tests creating property with mixed rdf:type rdf:JSON and non-JSON.", + "input": "fromRdf/js13-in.nq", + "expect": "fromRdf/js13-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} }, { "@id": "#tli01", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], diff --git a/tests/fromRdf/js12-in.nq b/tests/fromRdf/js12-in.nq new file mode 100644 index 00000000..8dddac6b --- /dev/null +++ b/tests/fromRdf/js12-in.nq @@ -0,0 +1,2 @@ +<http://example.org/vocab#id> <http://example.org/vocab#multi> "[\"string1\"]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . +<http://example.org/vocab#id> <http://example.org/vocab#multi> "[\"string2\"]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . diff --git a/tests/fromRdf/js12-out.jsonld b/tests/fromRdf/js12-out.jsonld new file mode 100644 index 00000000..9a0686ab --- /dev/null +++ b/tests/fromRdf/js12-out.jsonld @@ -0,0 +1,10 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#multi": [{ + "@value": ["string1"], + "@type": "@json" + }, { + "@value": ["string2"], + "@type": "@json" + }] +}] diff --git a/tests/fromRdf/js13-in.nq b/tests/fromRdf/js13-in.nq new file mode 100644 index 00000000..394bb536 --- /dev/null +++ b/tests/fromRdf/js13-in.nq @@ -0,0 +1,2 @@ +<http://example.org/vocab#id> <http://example.org/vocab#mixed> "null"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . +<http://example.org/vocab#id> <http://example.org/vocab#mixed> <http://example.org/vocab#value> . diff --git a/tests/fromRdf/js13-out.jsonld b/tests/fromRdf/js13-out.jsonld new file mode 100644 index 00000000..e2bcda7e --- /dev/null +++ b/tests/fromRdf/js13-out.jsonld @@ -0,0 +1,9 @@ +[{ + "@id": "http://example.org/vocab#id", + "http://example.org/vocab#mixed": [{ + "@value": null, + "@type": "@json" + }, { + "@id": "http://example.org/vocab#value" + }] +}] diff --git a/tests/toRdf-manifest.jsonld b/tests/toRdf-manifest.jsonld index 1d2c9267..9cc6a22b 100644 --- a/tests/toRdf-manifest.jsonld +++ b/tests/toRdf-manifest.jsonld @@ -2251,6 +2251,20 @@ "purpose": "Verifies that an exception is raised when attempting to redefine @context.", "input": "expand/er56-in.jsonld", "expectErrorCode": "keyword redefinition" + }, { + "@id": "#ter57", + "@type": ["jld:NegativeEvaluationTest", "jld:ToRDFTest" ], + "name": "Array not found for @json @list.", + "purpose": "The value for a @json @list term MUST be an array.", + "input": "toRdf/er57-in.jsonld", + "expectErrorCode": "invalid set or list object" + }, { + "@id": "#ter58", + "@type": ["jld:NegativeEvaluationTest", "jld:ToRDFTest" ], + "name": "Array not found for @json @set.", + "purpose": "The value for a @json @set term MUST be an array.", + "input": "toRdf/er58-in.jsonld", + "expectErrorCode": "invalid set or list object" }, { "@id": "#tin01", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], @@ -2507,6 +2521,62 @@ "input": "toRdf/js23-in.jsonld", "expect": "toRdf/js23-out.nq", "option": {"specVersion": "json-ld-1.1", "useJCS": true} + }, { + "@id": "#tjs24", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Transform JSON literal (one JSON literal).", + "purpose": "Tests transforming property with @type @json to a JSON literal (one JSON literal).", + "input": "toRdf/js24-in.jsonld", + "expect": "toRdf/js24-out.nq", + "option": {"specVersion": "json-ld-1.1", "useJCS": true} + }, { + "@id": "#tjs25", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Transform JSON literal (two JSON literals).", + "purpose": "Tests transforming property with @type @json to a JSON literal (two JSON literals).", + "input": "toRdf/js25-in.jsonld", + "expect": "toRdf/js25-out.nq", + "option": {"specVersion": "json-ld-1.1", "useJCS": true} + }, { + "@id": "#tjs26", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Transform JSON literal (JSON literal and non-JSON).", + "purpose": "Tests transforming property with @type @json to a JSON literal (JSON literal and non-JSON).", + "input": "toRdf/js26-in.jsonld", + "expect": "toRdf/js26-out.nq", + "option": {"specVersion": "json-ld-1.1", "useJCS": true} + }, { + "@id": "#tjs27", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Transform JSON literal (duplicate JSON literals).", + "purpose": "Tests transforming property with @type @json to a JSON literal (duplicate JSON literals).", + "input": "toRdf/js27-in.jsonld", + "expect": "toRdf/js27-out.nq", + "option": {"specVersion": "json-ld-1.1", "useJCS": true} + }, { + "@id": "#tjs28", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Transform array-like value with @json and no @set/@list in @context.", + "purpose": "Tests transforming array-like value with @json and no @set/@list in @context.", + "input": "toRdf/js28-in.jsonld", + "expect": "toRdf/js28-out.nq", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs29", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Transform array-like value with @json and @set in @context.", + "purpose": "Tests transforming array-like value with @json and @set in @context.", + "input": "toRdf/js29-in.jsonld", + "expect": "toRdf/js29-out.nq", + "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tjs30", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Transform array-like value with @json and @list in @context.", + "purpose": "Tests transforming array-like value with @json and @list in @context.", + "input": "toRdf/js30-in.jsonld", + "expect": "toRdf/js30-out.nq", + "option": {"specVersion": "json-ld-1.1"} }, { "@id": "#tli01", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], diff --git a/tests/toRdf/er57-in.jsonld b/tests/toRdf/er57-in.jsonld new file mode 100644 index 00000000..07e6339b --- /dev/null +++ b/tests/toRdf/er57-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "prop": { + "@id": "ex:prop", + "@type": "@json", + "@container": "@set" + } + }, + "prop": "value" +} diff --git a/tests/toRdf/er58-in.jsonld b/tests/toRdf/er58-in.jsonld new file mode 100644 index 00000000..3ea8be4c --- /dev/null +++ b/tests/toRdf/er58-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "prop": { + "@id": "ex:prop", + "@type": "@json", + "@container": "@list" + } + }, + "prop": "value" +} diff --git a/tests/toRdf/js24-in.jsonld b/tests/toRdf/js24-in.jsonld new file mode 100644 index 00000000..6031cc67 --- /dev/null +++ b/tests/toRdf/js24-in.jsonld @@ -0,0 +1,3 @@ +{ + "http://example.org/vocab#value": {"@value": ["JSON"], "@type": "@json"} +} diff --git a/tests/toRdf/js24-out.nq b/tests/toRdf/js24-out.nq new file mode 100644 index 00000000..8bf2d7a4 --- /dev/null +++ b/tests/toRdf/js24-out.nq @@ -0,0 +1 @@ +_:b0 <http://example.org/vocab#value> "[\"JSON\"]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . diff --git a/tests/toRdf/js25-in.jsonld b/tests/toRdf/js25-in.jsonld new file mode 100644 index 00000000..84ff724c --- /dev/null +++ b/tests/toRdf/js25-in.jsonld @@ -0,0 +1,6 @@ +{ + "http://example.org/vocab#value": [ + {"@value": ["JSON1"], "@type": "@json"}, + {"@value": ["JSON2"], "@type": "@json"} + ] +} diff --git a/tests/toRdf/js25-out.nq b/tests/toRdf/js25-out.nq new file mode 100644 index 00000000..53af01e9 --- /dev/null +++ b/tests/toRdf/js25-out.nq @@ -0,0 +1,2 @@ +_:b0 <http://example.org/vocab#value> "[\"JSON1\"]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . +_:b0 <http://example.org/vocab#value> "[\"JSON2\"]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . diff --git a/tests/toRdf/js26-in.jsonld b/tests/toRdf/js26-in.jsonld new file mode 100644 index 00000000..3f11042f --- /dev/null +++ b/tests/toRdf/js26-in.jsonld @@ -0,0 +1,6 @@ +{ + "http://example.org/vocab#value": [ + {"@value": ["JSON"], "@type": "@json"}, + {"@value": "non-JSON"} + ] +} diff --git a/tests/toRdf/js26-out.nq b/tests/toRdf/js26-out.nq new file mode 100644 index 00000000..cb658a4c --- /dev/null +++ b/tests/toRdf/js26-out.nq @@ -0,0 +1,2 @@ +_:b0 <http://example.org/vocab#value> "[\"JSON\"]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . +_:b0 <http://example.org/vocab#value> "non-JSON" . diff --git a/tests/toRdf/js27-in.jsonld b/tests/toRdf/js27-in.jsonld new file mode 100644 index 00000000..a0a817f2 --- /dev/null +++ b/tests/toRdf/js27-in.jsonld @@ -0,0 +1,6 @@ +{ + "http://example.org/vocab#value": [ + {"@value": [{"dup": true}], "@type": "@json"}, + {"@value": [{"dup": true}], "@type": "@json"} + ] +} diff --git a/tests/toRdf/js27-out.nq b/tests/toRdf/js27-out.nq new file mode 100644 index 00000000..6b84ec97 --- /dev/null +++ b/tests/toRdf/js27-out.nq @@ -0,0 +1 @@ +_:b0 <http://example.org/vocab#value> "[{\"dup\":true}]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . diff --git a/tests/toRdf/js28-in.jsonld b/tests/toRdf/js28-in.jsonld new file mode 100644 index 00000000..8a10ef58 --- /dev/null +++ b/tests/toRdf/js28-in.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "ex:e", "@type": "@json"} + }, + "e": ["v1", "v2"] +} diff --git a/tests/toRdf/js28-out.nq b/tests/toRdf/js28-out.nq new file mode 100644 index 00000000..379870bb --- /dev/null +++ b/tests/toRdf/js28-out.nq @@ -0,0 +1 @@ +_:b0 <ex:e> "[\"v1\",\"v2\"]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . diff --git a/tests/toRdf/js29-in.jsonld b/tests/toRdf/js29-in.jsonld new file mode 100644 index 00000000..a06649ee --- /dev/null +++ b/tests/toRdf/js29-in.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "ex:e", "@type": "@json", "@container": "@set"} + }, + "e": ["v1", "v2"] +} diff --git a/tests/toRdf/js29-out.nq b/tests/toRdf/js29-out.nq new file mode 100644 index 00000000..17b54b47 --- /dev/null +++ b/tests/toRdf/js29-out.nq @@ -0,0 +1,2 @@ +_:b0 <ex:e> "\"v1\""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . +_:b0 <ex:e> "\"v2\""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . diff --git a/tests/toRdf/js30-in.jsonld b/tests/toRdf/js30-in.jsonld new file mode 100644 index 00000000..aaa153d2 --- /dev/null +++ b/tests/toRdf/js30-in.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "@version": 1.1, + "e": {"@id": "ex:e", "@type": "@json", "@container": "@list"} + }, + "e": ["v1", "v2"] +} diff --git a/tests/toRdf/js30-out.nq b/tests/toRdf/js30-out.nq new file mode 100644 index 00000000..34766071 --- /dev/null +++ b/tests/toRdf/js30-out.nq @@ -0,0 +1,5 @@ +_:b0 <ex:e> _:b1 . +_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "\"v1\""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . +_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b2 . +_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "\"v2\""^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . +_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .