Skip to content

Add requirements for optional tests based on mf:requires. #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34,489 changes: 18,190 additions & 16,299 deletions reports/earl.jsonld

Large diffs are not rendered by default.

616 changes: 564 additions & 52 deletions reports/index.html

Large diffs are not rendered by default.

23,302 changes: 11,978 additions & 11,324 deletions reports/manifests.nt

Large diffs are not rendered by default.

3,104 changes: 1,862 additions & 1,242 deletions reports/ruby-json-ld-earl.ttl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Implementations create their own infrastructure for running the test suite. In p
* 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).
* Some _toRdf_ tests require the use of [JSON Canonicalization Scheme](https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05) to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using [RDF Dataset Isomorphism](https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism). These tests are marked using the `useJCS` option.
* 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)).
* Some tests may have a `requires` property, indicating some optional behavior described by a test vocabulary term.

# Contributing

Expand Down
1 change: 1 addition & 0 deletions tests/compact-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down
1 change: 1 addition & 0 deletions tests/expand-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down
1 change: 1 addition & 0 deletions tests/flatten-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down
1 change: 1 addition & 0 deletions tests/fromRdf-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down
1 change: 1 addition & 0 deletions tests/html-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down
3 changes: 2 additions & 1 deletion tests/manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3><a href="expand-manifest.jsonld">expand</a> tests have <em>input</em> and <e
<p>The <em>expected</em> results can be compared using <a href="#json-ld-object-comparison">JSON-LD object comparison</a> with the processor output.</p>

<p>For <em>NegativeEvaluationTests</em>, the result is a string associated with the expected error code.</p>
<h3><a href="html-manifest.jsonld">html</a> tests have <em>input</em> and <em>expected</em> documents and an optional <em>context</em> document.</h3>
<h3><a href="html.jsonld">html</a> tests have <em>input</em> and <em>expected</em> documents and an optional <em>context</em> document.</h3>

<p>The <em>expected</em> results can be compared using <a href="#json-ld-object-comparison">JSON-LD object comparison</a> with the processor output after potentially remapping blank node identifiers (see below). Additionally, if the result is compacted and the <code>ordered</code> option is not set, result should be expanded and compared with the expanded <em>expected</em> document also using <a href="#json-ld-object-comparison">JSON-LD object comparison</a>.</p>

Expand Down Expand Up @@ -110,6 +110,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down
1 change: 1 addition & 0 deletions tests/mk_vocab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
ontology: compacted['@graph'].detect {|o| o['@id'] == "https://w3c.github.io/json-ld-api/tests/vocab#"},
classes: compacted['@graph'].select {|o| o['@type'] == "rdfs:Class"}.sort_by {|o| o['rdfs:label']},
properties: compacted['@graph'].select {|o| o['@type'] == "rdf:Property"}.sort_by {|o| o['rdfs:label']},
requirements: compacted['@graph'].select {|o| o['@type'] == "mf:Requirement"}.sort_by {|o| o['rdfs:label']},
source: compacted.to_json(JSON::LD::JSON_STATE)
)
File.open("vocab.html", "w") {|fh| fh.write html}
Expand Down
1 change: 1 addition & 0 deletions tests/remote-doc-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down
4 changes: 4 additions & 0 deletions tests/template.haml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
* 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).
* Some _toRdf_ tests require the use of [JSON Canonicalization Scheme](https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05) to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using [RDF Dataset Isomorphism](https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism). These tests are marked using the `useJCS` option.
* 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)).
* Some tests may have a `requires` property, indicating some optional behavior described by a test vocabulary term.

# Contributing Tests

Expand Down Expand Up @@ -196,3 +197,6 @@
- entry['option'].each do |k, v|
%dt=k
%dd=v
- if entry['requires']
%dt="Requires"
%dd= entry['requires']
13 changes: 13 additions & 0 deletions tests/toRdf-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h1>Running tests</h1>
<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>
<li>Some <em>toRdf</em> tests require the use of <a href="https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-05">JSON Canonicalization Scheme</a> to properly generate RDF Literals from JSON literal values. This algorithm is non-normative, but is assumed to be used to properly compare results using <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism">RDF Dataset Isomorphism</a>. These tests are marked using the <code>useJCS</code> option.</li>
<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>
<li>Some tests may have a <code>requires</code> property, indicating some optional behavior described by a test vocabulary term.</li>
</ul>

<h1>Contributing Tests</h1>
Expand Down Expand Up @@ -970,6 +971,8 @@ <h2>
<dd>true</dd>
</dl>
</dd>
<dt>Requires</dt>
<dd>GeneralizedRdf</dd>
</dl>
</dd>
<dt id='t0119'>
Expand Down Expand Up @@ -2444,6 +2447,8 @@ <h2>
<dd>i18n-datatype</dd>
</dl>
</dd>
<dt>Requires</dt>
<dd>I18nDatatype</dd>
</dl>
</dd>
<dt id='tdi10'>
Expand Down Expand Up @@ -2474,6 +2479,8 @@ <h2>
<dd>i18n-datatype</dd>
</dl>
</dd>
<dt>Requires</dt>
<dd>I18nDatatype</dd>
</dl>
</dd>
<dt id='tdi11'>
Expand Down Expand Up @@ -2504,6 +2511,8 @@ <h2>
<dd>compound-literal</dd>
</dl>
</dd>
<dt>Requires</dt>
<dd>CompoundLiteral</dd>
</dl>
</dd>
<dt id='tdi12'>
Expand Down Expand Up @@ -2534,6 +2543,8 @@ <h2>
<dd>compound-literal</dd>
</dl>
</dd>
<dt>Requires</dt>
<dd>CompoundLiteral</dd>
</dl>
</dd>
<dt id='te001'>
Expand Down Expand Up @@ -4188,6 +4199,8 @@ <h2>
<dd>true</dd>
</dl>
</dd>
<dt>Requires</dt>
<dd>GeneralizedRdf</dd>
</dl>
</dd>
<dt id='te076'>
Expand Down
Loading