From e5fee91557335c458d7836582b1052aae5402ca1 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Mon, 8 Apr 2019 15:03:40 +0200 Subject: [PATCH 1/4] Fix toRdf-0088 for spec version 1.1 --- tests/toRdf/0088-in.jsonld | 5 ++--- tests/toRdf/0088-out.nq | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/toRdf/0088-in.jsonld b/tests/toRdf/0088-in.jsonld index 005f5e16..2d818d28 100644 --- a/tests/toRdf/0088-in.jsonld +++ b/tests/toRdf/0088-in.jsonld @@ -1,15 +1,14 @@ { "@context": { "term": "http://example.com/terms-are-not-considered-in-id", - "compact-iris": "http://example.com/compact-iris-", "property": "http://example.com/property", "@vocab": "http://example.org/vocab-is-not-considered-for-id" }, "@id": "term", "property": [ { - "@id": "compact-iris:are-considered", - "property": "@id supports the following values: relative, absolute, and compact IRIs" + "@id": "http://example.com/absolute-iri", + "property": "@id supports the following values: relative and absolute IRIs" }, { "@id": "../parent-node", diff --git a/tests/toRdf/0088-out.nq b/tests/toRdf/0088-out.nq index b8542727..9d2ba2ac 100644 --- a/tests/toRdf/0088-out.nq +++ b/tests/toRdf/0088-out.nq @@ -1,4 +1,4 @@ - "@id supports the following values: relative, absolute, and compact IRIs" . + "@id supports the following values: relative and absolute IRIs" . "relative IRIs get resolved against the document's base IRI" . . . From fa3f8e2b0915eb75a851206bb7d452b339e41ea9 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Mon, 8 Apr 2019 15:04:20 +0200 Subject: [PATCH 2/4] Add toRdf test for compact IRIs with @prefix --- tests/toRdf-manifest.jsonld | 8 ++++++++ tests/toRdf/0130-in.jsonld | 25 +++++++++++++++++++++++++ tests/toRdf/0130-out.nq | 6 ++++++ 3 files changed, 39 insertions(+) create mode 100644 tests/toRdf/0130-in.jsonld create mode 100644 tests/toRdf/0130-out.nq diff --git a/tests/toRdf-manifest.jsonld b/tests/toRdf-manifest.jsonld index a273e9e2..ba0578b7 100644 --- a/tests/toRdf-manifest.jsonld +++ b/tests/toRdf-manifest.jsonld @@ -879,6 +879,14 @@ "purpose": "IRI resolution according to RFC3986.", "input": "toRdf/0129-in.jsonld", "expect": "toRdf/0129-out.nq" + }, { + "@id": "#t0130", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Compact IRIs and prefix", + "purpose": "1.1 extension of toRdf-0088", + "input": "toRdf/0130-in.jsonld", + "expect": "toRdf/0130-out.nq", + "option": {"specVersion": "json-ld-1.1", "processingMode": "json-ld-1.1"} }, { "@id": "#th001", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], diff --git a/tests/toRdf/0130-in.jsonld b/tests/toRdf/0130-in.jsonld new file mode 100644 index 00000000..f0c19fc7 --- /dev/null +++ b/tests/toRdf/0130-in.jsonld @@ -0,0 +1,25 @@ +{ + "@context": { + "@version": 1.1, + "term": "http://example.com/terms-are-not-considered-in-id", + "compact-iris": { "@id": "http://example.com/compact-iris-", "@prefix": true }, + "safe-compact-iris": "http://example.com/safe-compact-iris/", + "property": "http://example.com/property", + "@vocab": "http://example.org/vocab-is-not-considered-for-id" + }, + "@id": "term", + "property": [ + { + "@id": "compact-iris:are-considered", + "property": "Compact IRIs with term definition ending with non-gen-delim character are only allowed with @prefix true" + }, + { + "@id": "safe-compact-iris:are-considered", + "property": "Compact IRIs with term definition ending with gen-delim character are always allowed" + }, + { + "@id": "../parent-node", + "property": "relative IRIs get resolved against the document's base IRI" + } + ] +} diff --git a/tests/toRdf/0130-out.nq b/tests/toRdf/0130-out.nq new file mode 100644 index 00000000..755b9e91 --- /dev/null +++ b/tests/toRdf/0130-out.nq @@ -0,0 +1,6 @@ + "Compact IRIs with term definition ending with non-gen-delim character are only allowed with @prefix true" . + "Compact IRIs with term definition ending with gen-delim character are always allowed" . + "relative IRIs get resolved against the document's base IRI" . + . + . + . From 2806342fa609e431a7c2129cfbab1e66fe1ec1fb Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Mon, 8 Apr 2019 15:06:26 +0200 Subject: [PATCH 3/4] Remove unneeded triple in tests/toRdf/0088-out.nq --- tests/toRdf/0088-out.nq | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/toRdf/0088-out.nq b/tests/toRdf/0088-out.nq index 9d2ba2ac..87445d84 100644 --- a/tests/toRdf/0088-out.nq +++ b/tests/toRdf/0088-out.nq @@ -1,4 +1,3 @@ "@id supports the following values: relative and absolute IRIs" . "relative IRIs get resolved against the document's base IRI" . - . . From bd4e9d5a6fc9a1d558d5361f681af694b943ca47 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Tue, 9 Apr 2019 15:16:43 +0200 Subject: [PATCH 4/4] Make toRdf @prefix tests require unsafe compact IRIs to be ignored --- tests/toRdf/0088-in.jsonld | 10 ++++++++-- tests/toRdf/0088-out.nq | 3 ++- tests/toRdf/0130-in.jsonld | 9 +++++++-- tests/toRdf/0130-out.nq | 4 ++-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/tests/toRdf/0088-in.jsonld b/tests/toRdf/0088-in.jsonld index 2d818d28..10a744b2 100644 --- a/tests/toRdf/0088-in.jsonld +++ b/tests/toRdf/0088-in.jsonld @@ -1,14 +1,20 @@ { "@context": { "term": "http://example.com/terms-are-not-considered-in-id", + "unsafe-compact-iris": "http://example.com/unsafe-compact-iris-", + "safe-compact-iris": "http://example.com/safe-compact-iris/", "property": "http://example.com/property", "@vocab": "http://example.org/vocab-is-not-considered-for-id" }, "@id": "term", "property": [ { - "@id": "http://example.com/absolute-iri", - "property": "@id supports the following values: relative and absolute IRIs" + "@id": "unsafe-compact-iris:are-considered", + "property": "@id supports the following values: relative, absolute, and compact IRIs ending with gen-delim character" + }, + { + "@id": "safe-compact-iris:are-considered", + "property": "@id supports the following values: relative, absolute, and compact IRIs ending with gen-delim character" }, { "@id": "../parent-node", diff --git a/tests/toRdf/0088-out.nq b/tests/toRdf/0088-out.nq index 87445d84..7aeaff9c 100644 --- a/tests/toRdf/0088-out.nq +++ b/tests/toRdf/0088-out.nq @@ -1,3 +1,4 @@ - "@id supports the following values: relative and absolute IRIs" . + "@id supports the following values: relative, absolute, and compact IRIs ending with gen-delim character" . "relative IRIs get resolved against the document's base IRI" . + . . diff --git a/tests/toRdf/0130-in.jsonld b/tests/toRdf/0130-in.jsonld index f0c19fc7..e74ed8ee 100644 --- a/tests/toRdf/0130-in.jsonld +++ b/tests/toRdf/0130-in.jsonld @@ -2,7 +2,8 @@ "@context": { "@version": 1.1, "term": "http://example.com/terms-are-not-considered-in-id", - "compact-iris": { "@id": "http://example.com/compact-iris-", "@prefix": true }, + "unsafe-compact-iris": "http://example.com/unsafe-compact-iris-", + "prefix-compact-iris": { "@id": "http://example.com/prefix-compact-iris-", "@prefix": true }, "safe-compact-iris": "http://example.com/safe-compact-iris/", "property": "http://example.com/property", "@vocab": "http://example.org/vocab-is-not-considered-for-id" @@ -10,7 +11,11 @@ "@id": "term", "property": [ { - "@id": "compact-iris:are-considered", + "@id": "unsafe-compact-iris:are-not-considered", + "property": "Compact IRIs with term definition ending with non-gen-delim character are not allowed" + }, + { + "@id": "prefix-compact-iris:are-considered", "property": "Compact IRIs with term definition ending with non-gen-delim character are only allowed with @prefix true" }, { diff --git a/tests/toRdf/0130-out.nq b/tests/toRdf/0130-out.nq index 755b9e91..8f0c8b36 100644 --- a/tests/toRdf/0130-out.nq +++ b/tests/toRdf/0130-out.nq @@ -1,6 +1,6 @@ - "Compact IRIs with term definition ending with non-gen-delim character are only allowed with @prefix true" . + "Compact IRIs with term definition ending with non-gen-delim character are only allowed with @prefix true" . "Compact IRIs with term definition ending with gen-delim character are always allowed" . "relative IRIs get resolved against the document's base IRI" . - . + . . .