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/0088-in.jsonld b/tests/toRdf/0088-in.jsonld index 005f5e16..10a744b2 100644 --- a/tests/toRdf/0088-in.jsonld +++ b/tests/toRdf/0088-in.jsonld @@ -1,15 +1,20 @@ { "@context": { "term": "http://example.com/terms-are-not-considered-in-id", - "compact-iris": "http://example.com/compact-iris-", + "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": "compact-iris:are-considered", - "property": "@id supports the following values: relative, absolute, and compact 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 b8542727..7aeaff9c 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, 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 new file mode 100644 index 00000000..e74ed8ee --- /dev/null +++ b/tests/toRdf/0130-in.jsonld @@ -0,0 +1,30 @@ +{ + "@context": { + "@version": 1.1, + "term": "http://example.com/terms-are-not-considered-in-id", + "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" + }, + "@id": "term", + "property": [ + { + "@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" + }, + { + "@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..8f0c8b36 --- /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" . + . + . + .