diff --git a/tests/cases/local-context/context.jsonld b/tests/cases/local-context/context.jsonld new file mode 100644 index 0000000..15e0381 --- /dev/null +++ b/tests/cases/local-context/context.jsonld @@ -0,0 +1,9 @@ +{ + "@context": { + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "schema": "https://schema.org/", + "$id": "@id", + "∈": "@type", + "$": "rdfs:label" + } +} \ No newline at end of file diff --git a/tests/cases/local-context/context.yamlld b/tests/cases/local-context/context.yamlld new file mode 100644 index 0000000..67d76db --- /dev/null +++ b/tests/cases/local-context/context.yamlld @@ -0,0 +1,7 @@ +"@context": + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# + schema: https://schema.org/ + + $id: "@id" + ∈: "@type" + $: rdfs:label diff --git a/tests/cases/local-context/jsonld-in.yamlld b/tests/cases/local-context/jsonld-in.yamlld new file mode 100644 index 0000000..f66a4e4 --- /dev/null +++ b/tests/cases/local-context/jsonld-in.yamlld @@ -0,0 +1,4 @@ +"@context": context.jsonld +$id: https://w3.org +∈: schema:Organization +$: The World Wide Web Consortium diff --git a/tests/cases/local-context/out.yamlld b/tests/cases/local-context/out.yamlld new file mode 100644 index 0000000..e69de29 diff --git a/tests/cases/local-context/yamlld-in.yamlld b/tests/cases/local-context/yamlld-in.yamlld new file mode 100644 index 0000000..1f01166 --- /dev/null +++ b/tests/cases/local-context/yamlld-in.yamlld @@ -0,0 +1,4 @@ +"@context": context.yamlld +$id: https://w3.org +∈: schema:Organization +$: The World Wide Web Consortium diff --git a/tests/manifest.jsonld b/tests/manifest.jsonld index 36562da..b93100c 100644 --- a/tests/manifest.jsonld +++ b/tests/manifest.jsonld @@ -233,6 +233,24 @@ "option": {"extractAllScripts": false}, "input": "cases/streams/two-documents-in.yamlld", "expect": "cases/streams/one-document-out.yamlld" + }, + { + "@id": "#local-json-ld-context", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Load a context from a local file in JSON-LD format.", + "req": "must", + "option": {"extractAllScripts": false}, + "input": "cases/local-context/jsonld-in.yamlld", + "expect": "cases/local-context/out.yamlld" + }, + { + "@id": "#local-yaml-ld-context", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Load a context from a local file in YAML-LD format.", + "req": "must", + "option": {"extractAllScripts": false}, + "input": "cases/local-context/yamlld-in.yamlld", + "expect": "cases/local-context/out.yamlld" } ] }