Skip to content

toRdf tests for @prefix #77

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

Closed
wants to merge 4 commits into from
Closed
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
8 changes: 8 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
11 changes: 8 additions & 3 deletions tests/toRdf/0088-in.jsonld
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/toRdf/0088-out.nq
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<http://example.com/compact-iris-are-considered> <http://example.com/property> "@id supports the following values: relative, absolute, and compact IRIs" .
<http://example.com/safe-compact-iris/are-considered> <http://example.com/property> "@id supports the following values: relative, absolute, and compact IRIs ending with gen-delim character" .
<https://w3c.github.io/json-ld-api/tests/parent-node> <http://example.com/property> "relative IRIs get resolved against the document's base IRI" .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <http://example.com/compact-iris-are-considered> .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <http://example.com/safe-compact-iris/are-considered> .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <https://w3c.github.io/json-ld-api/tests/parent-node> .
30 changes: 30 additions & 0 deletions tests/toRdf/0130-in.jsonld
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
6 changes: 6 additions & 0 deletions tests/toRdf/0130-out.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<http://example.com/prefix-compact-iris-are-considered> <http://example.com/property> "Compact IRIs with term definition ending with non-gen-delim character are only allowed with @prefix true" .
<http://example.com/safe-compact-iris/are-considered> <http://example.com/property> "Compact IRIs with term definition ending with gen-delim character are always allowed" .
<https://w3c.github.io/json-ld-api/tests/parent-node> <http://example.com/property> "relative IRIs get resolved against the document's base IRI" .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <http://example.com/prefix-compact-iris-are-considered> .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <http://example.com/safe-compact-iris/are-considered> .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <https://w3c.github.io/json-ld-api/tests/parent-node> .