Skip to content

Commit

Permalink
Update to latest RDF canonicalization test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotto committed Feb 28, 2024
1 parent 99090ed commit d013992
Show file tree
Hide file tree
Showing 197 changed files with 4,964 additions and 3,173 deletions.
8 changes: 6 additions & 2 deletions test/acceptance/canonicalization_w3c_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ defmodule RDF.Canonicalization.W3C.Test do

@path RDF.TestData.path("rdf-canon-tests")
@base "https://github.com/w3c/rdf-canon/tests/"
@manifest TestSuite.manifest_path(@path, "manifest-urdna2015.ttl")
@manifest TestSuite.manifest_path(@path, "manifest.ttl")
|> TestSuite.manifest_graph(base: @base)

TestSuite.test_cases(@manifest, RDFC.Urdna2015EvalTest)
TestSuite.test_cases(@manifest, RDFC.RDFC10EvalTest)
|> Enum.each(fn test_case ->
if RDFC.hashAlgorithm() in RDF.Description.predicates(test_case) do
@tag skip: "missing ability to change hash algorithm"
end

@tag test_case: test_case
test TestSuite.test_title(test_case), %{test_case: test_case} do
file_url = to_string(TestSuite.test_input_file(test_case))
Expand Down
Empty file modified test/data/rdf-canon-tests/LICENCE.md
100644 → 100755
Empty file.
30 changes: 29 additions & 1 deletion test/data/rdf-canon-tests/README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
## General instructions for running the RDF Dataset Canonicalization Test suites
FIXME

### Tests for RDFC-1.0 take input files, specified as N-Quads, and generate Canonical N-Quads output as required by the RDFC-1.0 algorithm.

The result file is in the N-Quads format.
The test passes if the result compares identically as the expected result as text files.

For a negative evaluation test, the test passes if the implementation generates an error due to excessive calls to
[Hash N-Degree Quads](https://www.w3.org/TR/rdf-canon/#hash-nd-quads-algorithm).

### Tests for RDFC-1.0 Issued Identifiers Map.

The result file is in the JSON format with keys representing
the blank node identifiers from the test input,
and values representing the associated canonical identifier
from the [issued identifiers map](https://www.w3.org/TR/rdf-canon/#dfn-issued-identifiers-map)
created as an alternate result
from [Step 7](https://www.w3.org/TR/rdf-canon/#ca.7) of the
[RDFC1.0 Canonicalization Algorithm](https://www.w3.org/TR/rdf-canon/#canon-algo-algo).
The test passes if the value of the resulting
[issued identifiers map](https://www.w3.org/TR/rdf-canon/#dfn-issued-identifiers-map)
matches the corresponding expected test result that can be loaded via the `result` field of the test.

Additionally, the keys of the [issued identifiers map](https://www.w3.org/TR/rdf-canon/#dfn-issued-identifiers-map)
must exactly match the values of the [input blank node identifier map](https://www.w3.org/TR/rdf-canon/#dfn-input-blank-node-identifier-map).
Note that all blank nodes appearing in the test appear in input blank node identifier map represent blank nodes and the specific value is not considered for test purposes

## Contributing Tests
The test manifests and entries are built automatically from
Expand All @@ -11,6 +35,10 @@ Tests may be contributed via pull request to
with suitable changes to the
[manifest.csv](manifest.csv) and necessary _action_ and _result_ files.

The [manifest-rdfc10.ttl](manifest-rdfc10.ttl), [manifest-rdfc10.jsonld](manifest-rdfc10.jsonld), and [index.html](index.html) files are built automatically via a GitHub Action when files change in this directory, and should not be edited directly.

The [vocab.html](vocab.html) and [vocab.jsonld](vocab.jsonld) files are built using [mk_vocab.rb](mk_vocab.rb) and are not build automatically by GitHub PR, as they change infrequently.

## Distribution
Distributed under both the
[W3C Test Suite License](http://www.w3.org/Consortium/Legal/2008/04-testsuite-license)
Expand Down
Loading

0 comments on commit d013992

Please sign in to comment.