Skip to content

Commit aa010da

Browse files
committed
Add xhtml version of html/e001.
Update test vocabulary, README, and manifest descriptions to describe default content types for test case properties identifying files, and how the _contentType_ option will override that for the _input_property.
1 parent 6100ead commit aa010da

14 files changed

+665
-334
lines changed

tests/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ Note that some tests require re-expansion and comparison, as list values may exi
6666
# Running tests
6767

6868
The top-level [manifest](manifest.jsonld) references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
69+
6970
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:
7071

7172
* _remote-doc_ tests will likely not return expected HTTP headers, so the _options_ should be used to determine what headers are associated with the input document.
73+
* Test case properties identifying a file (_input_, _output_, _context_, _expectContext_, and _frame_) are presumed to have a media type appropriate for the file extension.
74+
* `application/ld+json` for `.jsonld`
75+
* `text/html` for `.html`
76+
* `application/n-quads` for `.nq`
77+
* The media type for the file associated with the _input_ property can be overridden using the `contentType` option.
7278
* Some algorithms, particularly _fromRdf_, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of `@list`. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).
7379
* When comparing documents after flattening, framing or generating RDF, blank node identifiers may not be predictable. Implementations using the JSON-LD 1.0 algorithm, where output is always sorted and blank node identifiers are generated sequentially from `_:b0` may continue to use a simple object comparison. Otherwise, implementations should take this into consideration. (One way to do this may be to reduce both results and _expected_ to datsets to extract a bijective mapping of blank node labels between the two datasets as described in [RDF Dataset Isomorphism](https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism)).
7480

tests/compact-manifest.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,20 @@ <h2 id="json-ld-object-comparison">JSON-LD Object comparison</h2>
5656

5757
<h1>Running tests</h1>
5858

59-
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
60-
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
59+
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.</p>
60+
61+
<p>Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
6162

6263
<ul>
6364
<li><em>remote-doc</em> tests will likely not return expected HTTP headers, so the <em>options</em> should be used to determine what headers are associated with the input document.</li>
65+
<li>Test case properties identifying a file (<em>input</em>, <em>output</em>, <em>context</em>, <em>expectContext</em>, and <em>frame</em>) are presumed to have a media type appropriate for the file extension.
66+
67+
<ul>
68+
<li><code>application/ld+json</code> for <code>.jsonld</code></li>
69+
<li><code>text/html</code> for <code>.html</code></li>
70+
<li><code>application/n-quads</code> for <code>.nq</code></li>
71+
</ul></li>
72+
<li>The media type for the file associated with the <em>input</em> property can be overridden using the <code>contentType</code> option.</li>
6473
<li>Some algorithms, particularly <em>fromRdf</em>, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of <code>@list</code>. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).</li>
6574
<li>When comparing documents after flattening, framing or generating RDF, blank node identifiers may not be predictable. Implementations using the JSON-LD 1.0 algorithm, where output is always sorted and blank node identifiers are generated sequentially from <code>_:b0</code> may continue to use a simple object comparison. Otherwise, implementations should take this into consideration. (One way to do this may be to reduce both results and <em>expected</em> to datsets to extract a bijective mapping of blank node labels between the two datasets as described in <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>).</li>
6675
</ul>

tests/expand-manifest.html

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,20 @@ <h2 id="json-ld-object-comparison">JSON-LD Object comparison</h2>
5656

5757
<h1>Running tests</h1>
5858

59-
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
60-
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
59+
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.</p>
60+
61+
<p>Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
6162

6263
<ul>
6364
<li><em>remote-doc</em> tests will likely not return expected HTTP headers, so the <em>options</em> should be used to determine what headers are associated with the input document.</li>
65+
<li>Test case properties identifying a file (<em>input</em>, <em>output</em>, <em>context</em>, <em>expectContext</em>, and <em>frame</em>) are presumed to have a media type appropriate for the file extension.
66+
67+
<ul>
68+
<li><code>application/ld+json</code> for <code>.jsonld</code></li>
69+
<li><code>text/html</code> for <code>.html</code></li>
70+
<li><code>application/n-quads</code> for <code>.nq</code></li>
71+
</ul></li>
72+
<li>The media type for the file associated with the <em>input</em> property can be overridden using the <code>contentType</code> option.</li>
6473
<li>Some algorithms, particularly <em>fromRdf</em>, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of <code>@list</code>. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).</li>
6574
<li>When comparing documents after flattening, framing or generating RDF, blank node identifiers may not be predictable. Implementations using the JSON-LD 1.0 algorithm, where output is always sorted and blank node identifiers are generated sequentially from <code>_:b0</code> may continue to use a simple object comparison. Otherwise, implementations should take this into consideration. (One way to do this may be to reduce both results and <em>expected</em> to datsets to extract a bijective mapping of blank node labels between the two datasets as described in <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>).</li>
6675
</ul>
@@ -6183,6 +6192,62 @@ <h2>
61836192
</dd>
61846193
</dl>
61856194
</dd>
6195+
<dt id='tjs13'>
6196+
Test tjs13 Expand JSON literal with aliased @type
6197+
</dt>
6198+
<dd>
6199+
<dl class='entry'>
6200+
<dt>id</dt>
6201+
<dd>#tjs13</dd>
6202+
<dt>Type</dt>
6203+
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
6204+
<dt>Purpose</dt>
6205+
<dd>Tests expanding JSON literal with aliased @type.</dd>
6206+
<dt>input</dt>
6207+
<dd>
6208+
<a href='expand/js13-in.jsonld'>expand/js13-in.jsonld</a>
6209+
</dd>
6210+
<dt>expect</dt>
6211+
<dd>
6212+
<a href='expand/js13-out.jsonld'>expand/js13-out.jsonld</a>
6213+
</dd>
6214+
<dt>Options</dt>
6215+
<dd>
6216+
<dl class='options'>
6217+
<dt>specVersion</dt>
6218+
<dd>json-ld-1.1</dd>
6219+
</dl>
6220+
</dd>
6221+
</dl>
6222+
</dd>
6223+
<dt id='tjs14'>
6224+
Test tjs14 Expand JSON literal with aliased @value
6225+
</dt>
6226+
<dd>
6227+
<dl class='entry'>
6228+
<dt>id</dt>
6229+
<dd>#tjs14</dd>
6230+
<dt>Type</dt>
6231+
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
6232+
<dt>Purpose</dt>
6233+
<dd>Tests expanding JSON literal with aliased @value.</dd>
6234+
<dt>input</dt>
6235+
<dd>
6236+
<a href='expand/js14-in.jsonld'>expand/js14-in.jsonld</a>
6237+
</dd>
6238+
<dt>expect</dt>
6239+
<dd>
6240+
<a href='expand/js14-out.jsonld'>expand/js14-out.jsonld</a>
6241+
</dd>
6242+
<dt>Options</dt>
6243+
<dd>
6244+
<dl class='options'>
6245+
<dt>specVersion</dt>
6246+
<dd>json-ld-1.1</dd>
6247+
</dl>
6248+
</dd>
6249+
</dl>
6250+
</dd>
61866251
<dt id='tl001'>
61876252
Test tl001 Language map with null value
61886253
</dt>

tests/flatten-manifest.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,20 @@ <h2 id="json-ld-object-comparison">JSON-LD Object comparison</h2>
5656

5757
<h1>Running tests</h1>
5858

59-
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
60-
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
59+
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.</p>
60+
61+
<p>Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
6162

6263
<ul>
6364
<li><em>remote-doc</em> tests will likely not return expected HTTP headers, so the <em>options</em> should be used to determine what headers are associated with the input document.</li>
65+
<li>Test case properties identifying a file (<em>input</em>, <em>output</em>, <em>context</em>, <em>expectContext</em>, and <em>frame</em>) are presumed to have a media type appropriate for the file extension.
66+
67+
<ul>
68+
<li><code>application/ld+json</code> for <code>.jsonld</code></li>
69+
<li><code>text/html</code> for <code>.html</code></li>
70+
<li><code>application/n-quads</code> for <code>.nq</code></li>
71+
</ul></li>
72+
<li>The media type for the file associated with the <em>input</em> property can be overridden using the <code>contentType</code> option.</li>
6473
<li>Some algorithms, particularly <em>fromRdf</em>, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of <code>@list</code>. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).</li>
6574
<li>When comparing documents after flattening, framing or generating RDF, blank node identifiers may not be predictable. Implementations using the JSON-LD 1.0 algorithm, where output is always sorted and blank node identifiers are generated sequentially from <code>_:b0</code> may continue to use a simple object comparison. Otherwise, implementations should take this into consideration. (One way to do this may be to reduce both results and <em>expected</em> to datsets to extract a bijective mapping of blank node labels between the two datasets as described in <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>).</li>
6675
</ul>

tests/fromRdf-manifest.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,20 @@ <h2 id="json-ld-object-comparison">JSON-LD Object comparison</h2>
5151

5252
<h1>Running tests</h1>
5353

54-
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
55-
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
54+
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.</p>
55+
56+
<p>Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
5657

5758
<ul>
5859
<li><em>remote-doc</em> tests will likely not return expected HTTP headers, so the <em>options</em> should be used to determine what headers are associated with the input document.</li>
60+
<li>Test case properties identifying a file (<em>input</em>, <em>output</em>, <em>context</em>, <em>expectContext</em>, and <em>frame</em>) are presumed to have a media type appropriate for the file extension.
61+
62+
<ul>
63+
<li><code>application/ld+json</code> for <code>.jsonld</code></li>
64+
<li><code>text/html</code> for <code>.html</code></li>
65+
<li><code>application/n-quads</code> for <code>.nq</code></li>
66+
</ul></li>
67+
<li>The media type for the file associated with the <em>input</em> property can be overridden using the <code>contentType</code> option.</li>
5968
<li>Some algorithms, particularly <em>fromRdf</em>, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of <code>@list</code>. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).</li>
6069
<li>When comparing documents after flattening, framing or generating RDF, blank node identifiers may not be predictable. Implementations using the JSON-LD 1.0 algorithm, where output is always sorted and blank node identifiers are generated sequentially from <code>_:b0</code> may continue to use a simple object comparison. Otherwise, implementations should take this into consideration. (One way to do this may be to reduce both results and <em>expected</em> to datsets to extract a bijective mapping of blank node labels between the two datasets as described in <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>).</li>
6170
</ul>

tests/html-manifest.html

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,20 @@ <h2 id="json-ld-object-comparison">JSON-LD Object comparison</h2>
7171

7272
<h1>Running tests</h1>
7373

74-
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
75-
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
74+
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.</p>
75+
76+
<p>Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
7677

7778
<ul>
7879
<li><em>remote-doc</em> tests will likely not return expected HTTP headers, so the <em>options</em> should be used to determine what headers are associated with the input document.</li>
80+
<li>Test case properties identifying a file (<em>input</em>, <em>output</em>, <em>context</em>, <em>expectContext</em>, and <em>frame</em>) are presumed to have a media type appropriate for the file extension.
81+
82+
<ul>
83+
<li><code>application/ld+json</code> for <code>.jsonld</code></li>
84+
<li><code>text/html</code> for <code>.html</code></li>
85+
<li><code>application/n-quads</code> for <code>.nq</code></li>
86+
</ul></li>
87+
<li>The media type for the file associated with the <em>input</em> property can be overridden using the <code>contentType</code> option.</li>
7988
<li>Some algorithms, particularly <em>fromRdf</em>, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of <code>@list</code>. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).</li>
8089
<li>When comparing documents after flattening, framing or generating RDF, blank node identifiers may not be predictable. Implementations using the JSON-LD 1.0 algorithm, where output is always sorted and blank node identifiers are generated sequentially from <code>_:b0</code> may continue to use a simple object comparison. Otherwise, implementations should take this into consideration. (One way to do this may be to reduce both results and <em>expected</em> to datsets to extract a bijective mapping of blank node labels between the two datasets as described in <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>).</li>
8190
</ul>
@@ -140,6 +149,36 @@ <h2>
140149
</dd>
141150
</dl>
142151
</dd>
152+
<dt id='tex01'>
153+
Test tex01 Expands embedded JSON-LD script element (xhtml)
154+
</dt>
155+
<dd>
156+
<dl class='entry'>
157+
<dt>id</dt>
158+
<dd>#tex01</dd>
159+
<dt>Type</dt>
160+
<dd>jld:PositiveEvaluationTest, jld:ExpandTest, jld:HtmlTest</dd>
161+
<dt>Purpose</dt>
162+
<dd>Tests embedded JSON-LD in XHTML</dd>
163+
<dt>input</dt>
164+
<dd>
165+
<a href='html/e001-in.html'>html/e001-in.html</a>
166+
</dd>
167+
<dt>expect</dt>
168+
<dd>
169+
<a href='html/e001-out.jsonld'>html/e001-out.jsonld</a>
170+
</dd>
171+
<dt>Options</dt>
172+
<dd>
173+
<dl class='options'>
174+
<dt>specVersion</dt>
175+
<dd>json-ld-1.1</dd>
176+
<dt>contentType</dt>
177+
<dd>application/xhtml+xml</dd>
178+
</dl>
179+
</dd>
180+
</dl>
181+
</dd>
143182
<dt id='te002'>
144183
Test te002 Expands first embedded JSON-LD script element
145184
</dt>

tests/html-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
"input": "html/e001-in.html",
1414
"expect": "html/e001-out.jsonld",
1515
"option": {"specVersion": "json-ld-1.1"}
16+
}, {
17+
"@id": "#tex01",
18+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest", "jld:HtmlTest"],
19+
"name": "Expands embedded JSON-LD script element (xhtml)",
20+
"purpose": "Tests embedded JSON-LD in XHTML",
21+
"input": "html/e001-in.html",
22+
"expect": "html/e001-out.jsonld",
23+
"option": {"specVersion": "json-ld-1.1", "contentType": "application/xhtml+xml"}
1624
}, {
1725
"@id": "#te002",
1826
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest", "jld:HtmlTest"],

tests/manifest.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,20 @@ <h2 id="json-ld-object-comparison">JSON-LD Object comparison</h2>
9191

9292
<h1>Running tests</h1>
9393

94-
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
95-
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
94+
<p>The top-level <a href="manifest.jsonld">manifest</a> references the specific test manifests, which in turn reference each test associated with a particular type of behavior.</p>
95+
96+
<p>Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:</p>
9697

9798
<ul>
9899
<li><em>remote-doc</em> tests will likely not return expected HTTP headers, so the <em>options</em> should be used to determine what headers are associated with the input document.</li>
100+
<li>Test case properties identifying a file (<em>input</em>, <em>output</em>, <em>context</em>, <em>expectContext</em>, and <em>frame</em>) are presumed to have a media type appropriate for the file extension.
101+
102+
<ul>
103+
<li><code>application/ld+json</code> for <code>.jsonld</code></li>
104+
<li><code>text/html</code> for <code>.html</code></li>
105+
<li><code>application/n-quads</code> for <code>.nq</code></li>
106+
</ul></li>
107+
<li>The media type for the file associated with the <em>input</em> property can be overridden using the <code>contentType</code> option.</li>
99108
<li>Some algorithms, particularly <em>fromRdf</em>, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of <code>@list</code>. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).</li>
100109
<li>When comparing documents after flattening, framing or generating RDF, blank node identifiers may not be predictable. Implementations using the JSON-LD 1.0 algorithm, where output is always sorted and blank node identifiers are generated sequentially from <code>_:b0</code> may continue to use a simple object comparison. Otherwise, implementations should take this into consideration. (One way to do this may be to reduce both results and <em>expected</em> to datsets to extract a bijective mapping of blank node labels between the two datasets as described in <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>).</li>
101110
</ul>

0 commit comments

Comments
 (0)