From 63f2255e8a15e65c953d300c9c72937e25394060 Mon Sep 17 00:00:00 2001 From: Patrick Johnston Date: Fri, 29 Jun 2018 20:27:45 -0400 Subject: [PATCH 1/2] New test: frame-g010: Multiple named graphs --- test-suite/tests/frame-g010-frame.jsonld | 31 +++++++++++ test-suite/tests/frame-g010-in.jsonld | 61 +++++++++++++++++++++ test-suite/tests/frame-g010-out.jsonld | 69 ++++++++++++++++++++++++ test-suite/tests/frame-manifest.jsonld | 12 ++++- 4 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 test-suite/tests/frame-g010-frame.jsonld create mode 100644 test-suite/tests/frame-g010-in.jsonld create mode 100644 test-suite/tests/frame-g010-out.jsonld diff --git a/test-suite/tests/frame-g010-frame.jsonld b/test-suite/tests/frame-g010-frame.jsonld new file mode 100644 index 000000000..5d4545c1f --- /dev/null +++ b/test-suite/tests/frame-g010-frame.jsonld @@ -0,0 +1,31 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "loves": { + "@type": "@id" + }, + "unionOf": { + "@type": "@id", + "@id": "owl:unionOf", + "@container": "@list" + }, + "Class": "owl:Class" + }, + "@graph": [ + { + "@explicit": false, + "@embed": "@last", + "@type": [ + "Act", + "Class" + ], + "@graph": [{ + "@explicit": true, + "@embed": "@always", + "@type": "Person", + "@id": {}, + "loves": {"@embed": "@never"} + }] + } + ] +} \ No newline at end of file diff --git a/test-suite/tests/frame-g010-in.jsonld b/test-suite/tests/frame-g010-in.jsonld new file mode 100644 index 000000000..9947af30c --- /dev/null +++ b/test-suite/tests/frame-g010-in.jsonld @@ -0,0 +1,61 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "loves": { + "@type": "@id" + }, + "unionOf": { + "@type": "@id", + "@id": "owl:unionOf", + "@container": "@list" + }, + "Class": "owl:Class" + }, + "@graph": [ + { + "@type": "Act", + "@graph": [ + { + "@id": "Romeo", + "@type": "Person" + }, + { + "@id": "Juliet", + "@type": "Person" + } + ] + }, + { + "@id": "ActTwo", + "@type": "Act", + "@graph": [ + { + "@id": "Romeo", + "@type": "Person", + "loves": "Juliet" + }, + { + "@id": "Juliet", + "@type": "Person", + "loves": "Romeo" + } + ] + }, + { + "@id": "Person", + "@type": "Class", + "unionOf": { + "@list": [ + { + "@id": "Montague", + "@type": "Class" + }, + { + "@id": "Capulet", + "@type": "Class" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/test-suite/tests/frame-g010-out.jsonld b/test-suite/tests/frame-g010-out.jsonld new file mode 100644 index 000000000..2edc258d1 --- /dev/null +++ b/test-suite/tests/frame-g010-out.jsonld @@ -0,0 +1,69 @@ +{ + "@context": { + "@vocab": "http://example.com/", + "loves": { + "@type": "@id" + }, + "unionOf": { + "@type": "@id", + "@id": "owl:unionOf", + "@container": "@list" + }, + "Class": "owl:Class" + }, + "@graph": [ + { + "@graph": [ + { + "@id": "Juliet", + "@type": "Person", + "loves": null + }, + { + "@id": "Romeo", + "@type": "Person", + "loves": null + } + ], + "@type": "Act" + }, + { + "@graph": [ + { + "@id": "Juliet", + "@type": "Person", + "loves": "Romeo" + }, + { + "@id": "Romeo", + "@type": "Person", + "loves": "Juliet" + } + ], + "@id": "ActTwo", + "@type": "Act" + }, + { + "@id": "Capulet", + "@type": "Class" + }, + { + "@id": "Montague", + "@type": "Class" + }, + { + "@id": "Person", + "@type": "Class", + "unionOf": [ + { + "@id": "Montague", + "@type": "Class" + }, + { + "@id": "Capulet", + "@type": "Class" + } + ] + } + ] +} \ No newline at end of file diff --git a/test-suite/tests/frame-manifest.jsonld b/test-suite/tests/frame-manifest.jsonld index 0a8d4a5ac..bfe22a3ea 100644 --- a/test-suite/tests/frame-manifest.jsonld +++ b/test-suite/tests/frame-manifest.jsonld @@ -526,7 +526,17 @@ "frame": "frame-g009-frame.jsonld", "expect": "frame-g009-out.jsonld", "option": {"specVersion": "json-ld-1.1"} - }, { + },{ + "@id": "#tg010", + "@type": ["jld:PositiveEvaluationTest", "jld:FrameTest"], + "name": "Multiple named graphs", + "purpose": "Test embedded graphs", + "input": "frame-g010-in.jsonld", + "frame": "frame-g010-frame.jsonld", + "expect": "frame-g010-out.jsonld", + "option": {"pruneBlankNodeIdentifiers": true} + }, + { "@id": "#tp010", "@type": ["jld:PositiveEvaluationTest", "jld:FrameTest"], "name": "property CURIE conflict (prune bnodes)", From 3461fd0005cd8e338cd3729c4714163e9217e619 Mon Sep 17 00:00:00 2001 From: Patrick Johnston Date: Wed, 11 Jul 2018 15:11:16 -0400 Subject: [PATCH 2/2] fix after comment from @gkellog --- test-suite/tests/frame-g010-out.jsonld | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test-suite/tests/frame-g010-out.jsonld b/test-suite/tests/frame-g010-out.jsonld index 2edc258d1..fcffb9a83 100644 --- a/test-suite/tests/frame-g010-out.jsonld +++ b/test-suite/tests/frame-g010-out.jsonld @@ -12,21 +12,6 @@ "Class": "owl:Class" }, "@graph": [ - { - "@graph": [ - { - "@id": "Juliet", - "@type": "Person", - "loves": null - }, - { - "@id": "Romeo", - "@type": "Person", - "loves": null - } - ], - "@type": "Act" - }, { "@graph": [ { @@ -64,6 +49,21 @@ "@type": "Class" } ] + }, + { + "@graph": [ + { + "@id": "Juliet", + "@type": "Person", + "loves": null + }, + { + "@id": "Romeo", + "@type": "Person", + "loves": null + } + ], + "@type": "Act" } ] -} \ No newline at end of file +}